关于macOS:在RVM中安装Ruby 1.9.3时出错-产生错误

Error to install Ruby 1.9.3 in RVM - Make error

在OSX中使用RVM编译Ruby 1.9.3时出错。我已经搜索了很多解决方案,但不是常见错误。我认为这是一个权限错误,但我不知道如何解决。

查看我的make.log文件:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
[2013-04-03 09:37:41] make
    CC = clang
    LD = ld
    LDSHARED = clang -dynamiclib
    CFLAGS = -O2 -arch x86_64 -fno-common -pipe
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS = -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/opt/local/include -I. -I.ext/include/x86_64-darwin12.3.0 -I./include -I.
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -install_name /Users/brunno/.rvm/rubies/ruby-1.9.3-p392/lib/libruby.1.9.1.dylib -current_version 1.9.1 -compatibility_version 1.9.1  -Wl,-u,_objc_msgSend  
    SOLIBS =
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
compiling class.c
bignum.c:2732:26: warning: while loop has empty body [-Wempty-body]
        while (--ny && !zds[ny]); ++ny;
                                ^
bignum.c:2732:26: note: put the semicolon on a separate line to silence this warning
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
1 warning generated.
compiling file.c
compiling gc.c
compiling hash.c
compiling inits.c
compiling io.c
compiling marshal.c
compiling math.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
compiling regsyntax.c
compiling ruby.c
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
compiling strftime.c
compiling string.c
compiling struct.c
compiling time.c
compiling transcode.c
compiling util.c
compiling variable.c
compiling compile.c
compiling debug.c
compiling iseq.c
compiling vm.c
compiling vm_dump.c
compiling thread.c
thread.c:2550:34: warning: variable 'orig_read' is uninitialized when used within its own initialization [-Wuninitialized]
    rb_fdset_t UNINITIALIZED_VAR(orig_read);
                                 ^~~~~~~~~
./vm_core.h:115:34: note: expanded from macro 'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
                                 ^
thread.c:2551:34: warning: variable 'orig_write' is uninitialized when used within its own initialization [-Wuninitialized]
    rb_fdset_t UNINITIALIZED_VAR(orig_write);
                                 ^~~~~~~~~~
./vm_core.h:115:34: note: expanded from macro 'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
                                 ^
thread.c:2552:34: warning: variable 'orig_except' is uninitialized when used within its own initialization [-Wuninitialized]
    rb_fdset_t UNINITIALIZED_VAR(orig_except);
                                 ^~~~~~~~~~~
./vm_core.h:115:34: note: expanded from macro 'UNINITIALIZED_VAR'
#define UNINITIALIZED_VAR(x) x = x
                                 ^
compiling cont.c
compiling ./enc/ascii.c
compiling ./enc/us_ascii.c
compiling ./enc/unicode.c
3 warnings generated.
compiling ./enc/utf_8.c
compiling newline.c
compiling ./missing/setproctitle.c
compiling dln.c
compiling encoding.c
compiling dmyversion.c
linking miniruby
generating encdb.h
rbconfig.rb updated
generating enc.mk
generating prelude.c
compiling prelude.c
encdb.h unchanged
making srcs under enc
linking static-library libruby.1.9.1-static.a
make[1]: Nothing to be done for `srcs'.
generating transdb.h
transdb.h unchanged
linking shared-library libruby.1.9.1.dylib
making enc
making trans
compiling ./enc/trans/transdb.c
compiling ./enc/big5.c
compiling ./enc/encdb.c
compiling ./enc/cp949.c
compiling ./enc/trans/big5.c
configuring -test-/array/resize
configuring -test-/bug-3571
compiling ./enc/emacs_mule.c
configuring -test-/bug-3662
configuring -test-/funcall
configuring -test-/load/dot.dot
configuring -test-/old_thread_select
configuring -test-/st/numhash
configuring -test-/string
configuring -test-/wait_for_single_fd
configuring -test-/win32/dln
Failed to configure -test-/win32/dln. It will not be installed.
configuring -test-/win32/fd_setsize
Failed to configure -test-/win32/fd_setsize. It will not be installed.
compiling ./enc/trans/chinese.c
configuring bigdecimal
compiling ./enc/euc_jp.c
compiling ./enc/euc_kr.c
compiling ./enc/euc_tw.c
configuring continuation
configuring coverage
configuring curses
compiling ./enc/gb2312.c
compiling ./enc/gb18030.c
compiling ./enc/gbk.c
compiling ./enc/iso_8859_1.c
compiling ./enc/iso_8859_2.c
compiling ./enc/iso_8859_3.c
compiling ./enc/iso_8859_4.c
compiling ./enc/iso_8859_5.c
compiling ./enc/iso_8859_6.c
compiling ./enc/iso_8859_7.c
compiling ./enc/iso_8859_8.c
compiling ./enc/iso_8859_9.c
compiling ./enc/iso_8859_10.c
compiling ./enc/iso_8859_11.c
compiling ./enc/iso_8859_13.c
compiling ./enc/iso_8859_14.c
compiling ./enc/iso_8859_15.c
compiling ./enc/iso_8859_16.c
compiling ./enc/koi8_r.c
compiling ./enc/koi8_u.c
compiling ./enc/shift_jis.c
compiling ./enc/utf_16be.c
compiling ./enc/trans/emoji.c
compiling ./enc/utf_16le.c
compiling ./enc/utf_32be.c
compiling ./enc/utf_32le.c
compiling ./enc/windows_1251.c
linking encoding encdb.bundle
linking encoding big5.bundle
compiling ./enc/trans/emoji_iso2022_kddi.c
linking encoding cp949.bundle
linking encoding emacs_mule.bundle
linking encoding euc_jp.bundle
linking encoding euc_kr.bundle
linking encoding euc_tw.bundle
linking encoding gb2312.bundle
linking encoding gb18030.bundle
linking encoding gbk.bundle
linking encoding iso_8859_1.bundle
linking encoding iso_8859_2.bundle
linking encoding iso_8859_3.bundle
linking encoding iso_8859_4.bundle
linking encoding iso_8859_5.bundle
linking encoding iso_8859_6.bundle
linking encoding iso_8859_7.bundle
linking encoding iso_8859_8.bundle
linking encoding iso_8859_9.bundle
linking encoding iso_8859_10.bundle
linking encoding iso_8859_11.bundle
linking encoding iso_8859_13.bundle
linking encoding iso_8859_14.bundle
linking encoding iso_8859_15.bundle
linking encoding iso_8859_16.bundle
linking encoding koi8_r.bundle
linking encoding koi8_u.bundle
linking encoding shift_jis.bundle
linking encoding utf_16be.bundle
linking encoding utf_16le.bundle
linking encoding utf_32be.bundle
linking encoding utf_32le.bundle
linking encoding windows_1251.bundle
compiling ./enc/trans/emoji_sjis_docomo.c
compiling ./enc/trans/emoji_sjis_kddi.c
compiling ./enc/trans/emoji_sjis_softbank.c
compiling ./enc/trans/escape.c
compiling ./enc/trans/gb18030.c
compiling ./enc/trans/gbk.c
compiling ./enc/trans/iso2022.c
compiling ./enc/trans/japanese.c
compiling ./enc/trans/japanese_euc.c
compiling ./enc/trans/japanese_sjis.c
configuring date
configuring dbm
configuring digest
configuring digest/bubblebabble
configuring digest/md5
configuring digest/rmd160
compiling ./enc/trans/korean.c
configuring digest/sha1
configuring digest/sha2
compiling ./enc/trans/single_byte.c
configuring dl
compiling ./enc/trans/utf8_mac.c
compiling ./enc/trans/utf_16_32.c
linking transcoder transdb.bundle
linking transcoder big5.bundle
linking transcoder chinese.bundle
linking transcoder emoji.bundle
linking transcoder emoji_iso2022_kddi.bundle
linking transcoder emoji_sjis_docomo.bundle
linking transcoder emoji_sjis_kddi.bundle
linking transcoder emoji_sjis_softbank.bundle
linking transcoder escape.bundle
configuring dl/callback
configuring dl/win32
Failed to configure dl/win32. It will not be installed.
configuring etc
linking transcoder gb18030.bundle
linking transcoder gbk.bundle
linking transcoder iso2022.bundle
linking transcoder japanese.bundle
linking transcoder japanese_euc.bundle
linking transcoder japanese_sjis.bundle
linking transcoder single_byte.bundle
linking transcoder utf8_mac.bundle
linking transcoder utf_16_32.bundle
linking transcoder korean.bundle
making encs
configuring fcntl
configuring fiber
configuring fiddle
configuring gdbm
configuring iconv
configuring io/console
configuring io/nonblock
configuring io/wait
configuring json
configuring json/generator
configuring json/parser
configuring mathn/complex
configuring mathn/rational
configuring nkf
configuring objspace
configuring openssl
configuring pathname
configuring psych
configuring pty
configuring racc/cparse
configuring readline
configuring ripper
configuring sdbm
configuring socket
configuring stringio
configuring strscan
configuring syck
configuring syslog
configuring tk/tkutil
Failed to configure tk/tkutil. It will not be installed.
configuring win32ole
Failed to configure win32ole. It will not be installed.
configuring zlib
compiling resize.c
compiling bug.c
compiling bug.c
compiling passing_block.c
installing default bug libraries
installing default funcall libraries
linking shared-object -test-/bug-3571/bug.bundle
installing default bug libraries
linking shared-object -test-/funcall/funcall.bundle
linking shared-object -test-/bug-3662/bug.bundle
installing default resize libraries
linking shared-object -test-/array/resize.bundle
ld: can't open output file for writing: ../../../.ext/x86_64-darwin12.3.0/-test-/bug-3571/bug.bundle, errno=2 for architecture x86_64
ld: can't open output file for writing: ../../../.ext/x86_64-darwin12.3.0/-test-/bug-3662/bug.bundle, errno=2 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: can't open output file for writing: ../../../.ext/x86_64-darwin12.3.0/-test-/funcall/funcall.bundle, errno=2 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../../.ext/x86_64-darwin12.3.0/-test-/bug-3662/bug.bundle] Error 1
make[1]: *** [ext/-test-/bug-3662/all] Error 2
make[2]: *** [../../../.ext/x86_64-darwin12.3.0/-test-/funcall/funcall.bundle] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [ext/-test-/funcall/all] Error 2
make[2]: *** [../../../.ext/x86_64-darwin12.3.0/-test-/bug-3571/bug.bundle] Error 1
make[1]: *** [ext/-test-/bug-3571/all] Error 2
ld: can't open output file for writing: ../../../../.ext/x86_64-darwin12.3.0/-test-/array/resize.bundle, errno=2 for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [../../../../.ext/x86_64-darwin12.3.0/-test-/array/resize.bundle] Error 1
make[1]: *** [ext/-test-/array/resize/all] Error 2
make: *** [build-ext] Error 2

谢谢你们的时间家伙!


我知道这个问题已经回答了,但是我想我会提供解决此问题的 所需的命令:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cd ~/.rvm/src/ruby-1.9.3-p392
mkdir -p .ext/x86_64-darwin12.3.0/-test-/array
mkdir -p .ext/x86_64-darwin12.3.0/-test-/bug-3571
mkdir -p .ext/x86_64-darwin12.3.0/-test-/bug-3662
mkdir -p .ext/x86_64-darwin12.3.0/-test-/funcall/
mkdir -p .ext/x86_64-darwin12.3.0/-test-/load/dot.dot/
mkdir -p .ext/x86_64-darwin12.3.0/-test-/old_thread_select
mkdir -p .ext/x86_64-darwin12.3.0/-test-/st
mkdir -p .ext/x86_64-darwin12.3.0/-test-/string
mkdir -p .ext/x86_64-darwin12.3.0/-test-/wait_for_single_fd
mkdir -p .ext/x86_64-darwin12.3.0/digest
mkdir -p .ext/x86_64-darwin12.3.0/dl
mkdir -p .ext/x86_64-darwin12.3.0/io
mkdir -p .ext/x86_64-darwin12.3.0/json/ext
mkdir -p .ext/x86_64-darwin12.3.0/mathn


日志明确指出:

1
ld: can't open output file for writing: ../../../.ext/x86_64-darwin12.3.0/

赋予她能力:-)
只需创建一个文件夹并chown即可。


我遇到了同样的问题,但是使用ruby 2.0.0

这有所帮助(感谢@ dr4g0n):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
cd ~/.rvm/src/ruby-2.0.0-p195/.ext/x86_64-darwin12.4.0
mkdir -p ./-test-/array
mkdir -p ./-test-/bug-3571
mkdir -p ./-test-/bug-3662
mkdir -p ./-test-/funcall/
mkdir -p ./-test-/load/dot.dot/
mkdir -p ./-test-/old_thread_select
mkdir -p ./-test-/st
mkdir -p ./-test-/string
mkdir -p ./-test-/wait_for_single_fd
mkdir -p ./digest
mkdir -p ./dl
mkdir -p ./io
mkdir -p ./json/ext
mkdir -p ./mathn
mkdir -p ./racc
mkdir -p ./-test-/bug-5832/
mkdir -p ./-test-/fatal/
mkdir -p ./-test-/marshal/
mkdir -p ./-test-/iter/
mkdir -p ./-test-/num2int/
mkdir -p ./-test-/path_to_class/
mkdir -p ./-test-/symbol/
mkdir -p ./-test-/typeddata/