【问题标题】:ox -v 2.0.11 Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extensionox -v 2.0.11 Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
【发布时间】:2013-11-30 21:14:51
【问题描述】:

Mac OSX Mountain Lion、Rails 4.0.0、Ruby 1.9.3、Postgresql

我正在和我的一个朋友一起做一个项目,当我克隆到他的主代码(使用“git clone”)并尝试运行“bundle install”时,我收到了以下消息:

    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”,但这也以相同的消息结束。

关于为什么会发生这种情况的任何想法?

谢谢!

【问题讨论】:

  • 手动尝试添加旧版本的 ox gem 是否有效?
  • 不,我收到相同的错误消息。 :(
  • 查看 github here 上的问题,似乎有些人在构建 gem 时遇到了问题。我只是 gem install ox 使用 ruby​​-2.0.0-p247 并且一切都很好 - 所以可能值得看看不同的 ruby​​ 版本会发生什么。
  • 我安装了所有的 gem!感谢皮平的帮助!
  • 你应该发布解决方案。 :) 以防其他人遇到类似的问题。

标签: ruby-on-rails macos git postgresql


【解决方案1】:

问题解决了!谢谢皮平!

我使用 rvm 安装了一个不同版本的 ruby​​——如果你没有它,这里是一个指向该站点的链接 https://rvm.io/ 或下载你可以在你的终端中使用以下命令:“$\curl -L https://get.rvm.io | 重击"

以下是我用来加载新 ruby​​ 版本的命令:

    rvm get head
    brew install autoconf automake
    rvm reload
    rvm use ruby-1.9.3-p327-fast --default

然后重新运行“捆绑安装”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-03-03
    • 2020-11-08
    • 1970-01-01
    • 1970-01-01
    • 2021-08-14
    • 1970-01-01
    • 2021-07-06
    相关资源
    最近更新 更多