2011-12-18 124 views
2

安裝rb-appscript時出現大問題。 我已經安裝了最新版本的xCode &我正在運行Lion。安裝rb-appscript時出錯

希望你能幫助我,非常感謝!

這是錯誤消息:

sudo gem install rb-appscript 
Building native extensions. This could take a while... 
ERROR: Error installing rb-appscript: 
    ERROR: Failed to build gem native extension. 

     /usr/local/bin/ruby extconf.rb 
create /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/src/osx_ruby.h ... 
create /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/src/osx_intern.h ... 
creating Makefile 

make 
Makefile:188: warning: overriding commands for target `/usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/lib' 
Makefile:182: warning: ignoring old commands for target `/usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/lib' 
gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -Isrc -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -Wall -c src/rbae.c 
gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -Isrc -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -Wall -c src/SendThreadSafe.c 
cc -dynamic -bundle -undefined suppress -flat_namespace -o ae.bundle rbae.o SendThreadSafe.o -L. -L/usr/local/lib -L. -framework Carbon -framework ApplicationServices -lruby -lpthread -ldl -lobjc 
ld: warning: ignoring file /usr/local/lib/libruby.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) 
ld: in /usr/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64 
collect2: ld returned 1 exit status 
make: *** [ae.bundle] Error 1 


Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1 for inspection. 
Results logged to /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/./gem_make.out 

回答

0

好像事情是不對您的安裝紅寶石。它在這裏抱怨錯誤的架構

ld: warning: ignoring file /usr/local/lib/libruby.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) 
ld: in /usr/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64 

確保你的ruby安裝正確。對於一個超級簡單的Ruby安裝,我會推薦Ruby版本管理器 - >https://rvm.io

+0

感謝您的幫助!試過這個,使用這個命令:「$ bash <<(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)」。安裝成功後,我嘗試再次運行rb-appscript命令,但沒有運氣。是否有可能,這個問題來自我的xCode? (4.2.1已安裝)< - 在某處讀取,這可能有問題與紅寶石?!任何想法如何解決它? – Tobias 2011-12-18 14:25:50

+0

「osx-gcc-installer」可以解決我的問題嗎?只是發現它... – Tobias 2011-12-18 14:29:49

+0

我不在OSX上,所以不能幫助。你使用rvm安裝的ruby版本嗎?嘗試「rvm install 1.8.7」和「rvm 1.8.7」,看看是否一切正常。 – ben 2011-12-18 18:19:31