【问题标题】:ERROR while installing rb-appscript安装 rb-appscript 时出错
【发布时间】:2012-01-23 00:17:44
【问题描述】:

安装 rb-appscript 时遇到大问题。 我已经安装了最新版本的 xCode 并且正在运行 Lion。

希望你能帮助我,非常感谢!

这是错误信息:

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

【问题讨论】:

    标签: ruby macos rb-appscript


    【解决方案1】:

    您的 Ruby 安装似乎有问题。它在这里抱怨架构错误

    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

    【讨论】:

    • 感谢您的帮助!尝试了这个,使用这个命令:“$ bash raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)”。成功安装后,我尝试再次运行 rb-appscript 命令,但没有成功。有可能,问题来自我的xCode吗? (已安装 4.2.1)
    • 我不在 OSX 上,所以对此无能为力。您使用的是 rvm 安装的 ruby​​ 版本吗?试试 'rvm install 1.8.7' 和 'rvm 1.8.7' 看看是否一切正常。
    • 完全重新安装了 Lion,解决了我的问题。猜猜它以某种方式连接到之前在 Leopard 和 Snow Leopard 上安装的 xCode 版本。感谢您的帮助@ben!
    猜你喜欢
    • 2012-03-28
    • 2015-10-08
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多