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

Can't install gems in ruby-head / 2.0.0-preview1 when using https://rubygems.org source #1290

Closed
jfirebaugh opened this issue Nov 3, 2012 · 10 comments
Assignees
Milestone

Comments

@jfirebaugh
Copy link

I have the following in my .gemrc, as IMO everybody should for security reasons:

:sources:
  - https://rubygems.org

I find I can't install any gems into a fresh ruby-head or 2.0.0-preview1 install:

$ gem install bundler
/Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require': cannot load such file -- openssl (LoadError)
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/net/https.rb:22:in `<top (required)>'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/custom_require.rb:36:in `require'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/remote_fetcher.rb:345:in `configure_connection_for_https'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/remote_fetcher.rb:323:in `connection_for'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/remote_fetcher.rb:413:in `request'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/remote_fetcher.rb:205:in `fetch_http'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/remote_fetcher.rb:238:in `fetch_path'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:260:in `load_specs'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:231:in `block in list'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:227:in `each'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:227:in `list'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:150:in `find_matching_with_errors'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/spec_fetcher.rb:89:in `fetch_with_errors'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:110:in `find_gems_with_sources'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:228:in `find_spec_by_name_and_version'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/dependency_installer.rb:259:in `install'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/commands/install_command.rb:121:in `block in execute'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/commands/install_command.rb:115:in `each'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/commands/install_command.rb:115:in `execute'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/command.rb:278:in `invoke'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:147:in `process_args'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/command_manager.rb:117:in `run'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/lib/ruby/site_ruby/2.0.0/rubygems/gem_runner.rb:65:in `run'
    from /Users/john/.rvm/rubies/ruby-2.0.0-preview1/bin/gem:25:in `<main>'

Is openssl not bundled with these rubies? Can it be?

@jfirebaugh
Copy link
Author

From rbenv/ruby-build#197 I learned that Ruby 2 is incompatible with the version of OpenSSL bundled with MacOS, so it doesn't compile the extension.

I got things working with homebrew openssl using:

rvm reinstall --disable-binary ruby-2.0.0-preview1 --with-openssl-dir=`brew --prefix openssl`

It would be nice if rvm detected this situation automatically and used the rvm pkg install openssl solution mentioned here.

@jfirebaugh
Copy link
Author

The --disable-binary is due to #1286, BTW.

@nikosd
Copy link

nikosd commented Nov 3, 2012

@jfirebaugh your comment also replies to my question here : https://groups.google.com/d/topic/rubyversionmanager/QJpJHscxudI/discussion

@jfirebaugh
Copy link
Author

See this gist for an updated incantation:

https://gist.github.com/4007524

@ghost ghost assigned mpapis Nov 9, 2012
@mpapis mpapis closed this as completed in 7f7e6b2 Nov 9, 2012
@mpapis
Copy link
Member

mpapis commented Nov 9, 2012

RVM will now install openssl on OSX for ruby 2.0, in case of brew it can be skipped this way:

rvm install ruby-2.0.0 --skip-openssl --with-opt-dir="`brew --prefix openssl`"

@balexand
Copy link

balexand commented Nov 9, 2012

Thanks @jfirebaugh! The Homebrew instructions from your gist worked great.

@tonyarnold
Copy link

Does this still work? With Ruby 2.0.0 rc1 I still get the OpenSSL errors with a completely clean install of RVM.

@balexand
Copy link

balexand commented Feb 4, 2013

@tonyarnold Have you tried running rvm pkg install openssl then reinstalling Ruby? That worked for me.

@tonyarnold
Copy link

@balexand — yes, from a fresh install of RVM, this yields the error seen above (but for Ruby 2.0.0-rc1)

@mpapis
Copy link
Member

mpapis commented Feb 4, 2013

@tonyarnold please open a new ticket including:

rvm get head
rvm pkg remove
rvm remove 2.0.0
rvm install 2.0.0 --debug

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

5 participants