Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem installing gem with native extensions #255

Closed
kurko opened this issue Feb 28, 2014 · 2 comments
Closed

Problem installing gem with native extensions #255

kurko opened this issue Feb 28, 2014 · 2 comments

Comments

@kurko
Copy link

kurko commented Feb 28, 2014

I decided to give chruby a try in a new Mac. It worked like a charm, except for one thing: installing gems that have native extensions.

When trying to rule out the causing factors, I installed rbenv (which I have been using for years) and it worked just fine, so I conclude it's something to do with chruby.

I'm running Mountain Lion.

Reproducing

→ gem install ffi
Building native extensions.  This could take a while...
ERROR:  Error installing ffi:
        ERROR: Failed to build gem native extension.

    /Users/admin/.rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
/Users/admin/.rubies/ruby-2.0.0-p353/bin/ruby: invalid option -2  (-h will show valid options) (RuntimeError)

extconf failed, exit code 1

Gem files will remain installed in /Users/admin/.gem/ruby/2.0.0/gems/ffi-1.9.3 for inspection.
Results logged to /Users/admin/.gem/ruby/2.0.0/extensions/x86_64-darwin-13/2.0.0-static/ffi-1.9.3/gem_make.out

Here's gem_make.out:

→ cat /Users/admin/.gem/ruby/2.0.0/extensions/x86_64-darwin-13/2.0.0-static/ffi-1.9.3/gem_make.out
/Users/admin/.rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
/Users/admin/.rubies/ruby-2.0.0-p353/bin/ruby: invalid option -2  (-h will show valid options) (RuntimeError)

extconf failed, exit code 1

I'll just continue using rbenv now, but I think this would help improving the project :)

@postmodern
Copy link
Owner

I'm guessing you did chruby ruby 2.0.0-p353 instead of chruby ruby-2.0.0. The second argument of chruby actually sets RUBYOPT.

@tomquas
Copy link

tomquas commented Mar 5, 2014

@postmodern confirmed. i made the same mistake. my RUBYOPT contained '2.1.1', unsetting it fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants