简体   繁体   中英

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

I am working on a project with one of my friends and when I cloned into his master code (using "git clone") and tried running "bundle install" I received the following message:

    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.

And I received the exact same ERROR message after installing Postgresql locally and creating a new path as suggested in a similar StackOverflow question:

    PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

I have also tried to install the gem manually "gem install ox -v 2.0.11", but that also ends with the same message.

Any ideas in regards to why this is happening?

Thanks!

Problem solved! Thanks Pippin!

I installed a different version of ruby using rvm -- if you don't have it here is a link to the site https://rvm.io/ or to download you can use the following command in your terminal: "$\\curl -L https://get.rvm.io | bash"

Following are the commands I used to load the new ruby version:

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

Then rerun "bundle install".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM