[英]Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension on Mac
[英]ox -v 2.0.11 Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
Mac OSX Mountain Lion,Rails 4.0.0,Ruby 1.9.3,Postgresql
我正在与一个朋友一起从事一个项目,当我克隆到他的主代码(使用“ git clone”)并尝试运行“捆绑安装”时,收到以下消息:
unknown00231254a715:grablink shaunbarnes$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.8.1)
Using atomic (1.1.14)
Using thread_safe (0.1.3)
Using tzinfo (0.3.38)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.25)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using addressable (2.3.5)
Using bcrypt-ruby (3.1.2)
Using coffee-script-source (1.6.3)
Using execjs (2.0.2)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.0)
Using commonjs (0.2.6)
Using orm_adapter (0.4.0)
Using warden (1.2.3)
Using devise (3.1.1)
Using rest-client (1.6.7)
Using dwolla-ruby (2.5.0)
Using bundler (1.3.5)
Using hike (1.2.3)
Using tilt (1.4.1)
Using sprockets (2.10.0)
Using sprockets-rails (2.0.0)
Using rails (4.0.0)
Using filepicker-rails (1.0.0) from git://github.com/Ink/filepicker-rails.git (at master)
Using jbuilder (1.5.2)
Using jquery-rails (3.0.4)
Using json (1.8.0)
Using less (2.3.2)
Using less-rails (2.3.3)
Using libv8 (3.11.8.17)
Installing ox (2.0.11)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
>>>>> Creating Makefile for ruby version 1.9.3 on x86_64-darwin10.8.0 <<<<<
creating Makefile
make
compiling base64.c
compiling cache.c
compiling cache8.c
compiling cache8_test.c
compiling cache_test.c
compiling dump.c
compiling err.c
compiling gen_load.c
compiling obj_load.c
compiling ox.c
compiling parse.c
compiling sax.c
sax.c:90: error: expected declaration specifiers or ‘...’ before numeric constant
sax.c:90: error: expected ‘)’ before ‘!=’ token
sax.c:90: error: expected ‘)’ before ‘?’ token
make: *** [sax.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/ox-2.0.11 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/ox-2.0.11/ext/ox/gem_make.out
An error occurred while installing ox (2.0.11), and Bundler cannot continue.
Make sure that `gem install ox -v '2.0.11'` succeeds before bundling.
在本地安装Postgresql并按照类似的StackOverflow问题中的建议创建新路径后,我收到了完全相同的错误消息:
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
我也尝试过手动安装gem“ gem install ox -v 2.0.11”,但是也以相同的消息结尾。
关于为什么发生这种情况有什么想法吗?
谢谢!
问题解决了! 谢谢皮蓬!
我使用rvm安装了不同版本的ruby -如果您没有它,这里是指向站点https://rvm.io/的链接,或者可以在终端中使用以下命令进行下载:“ $ \\ curl -L https://get.rvm.io | bash”
以下是我用于加载新的ruby版本的命令:
rvm get head
brew install autoconf automake
rvm reload
rvm use ruby-1.9.3-p327-fast --default
然后重新运行“捆绑安装”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.