“Não é possível carregar esse arquivo - openssl” ao executar o bundle

3

Quando tento usar o bundler , recebo o erro:

  

/home/vivek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require': não é possível carregar esse arquivo - openssl (LoadError)

A mensagem de erro completa está abaixo. Como faço para corrigir isso?

Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please report this error to the Bundler issue tracker at https://github.com/carlhuda/bundler/issues so that we can fix it. Please include the full output of the command, your Gemfile and Gemfile.lock. Thanks!
/home/vivek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require': cannot load such file -- openssl (LoadError)
    from /home/vivek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
    from /home/vivek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/net/https.rb:22:in '<top (required)>'
    from /home/vivek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
    from /home/vivek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:447:in 'ssl'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:216:in 'connection_for'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:358:in 'request'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:135:in 'fetch'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:163:in 'fetch_dependency_remote_specs'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:122:in 'fetch_remote_specs'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/fetcher.rb:70:in 'specs'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:234:in 'block in remote_specs'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:232:in 'each'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:232:in 'remote_specs'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:165:in 'fetch_specs'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/source.rb:70:in 'specs'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:205:in 'block (2 levels) in index'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:202:in 'each'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:202:in 'block in index'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/index.rb:9:in 'build'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:198:in 'index'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:192:in 'resolve'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:127:in 'specs'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/definition.rb:122:in 'resolve_remotely!'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/installer.rb:48:in 'run'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/installer.rb:12:in 'install'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/cli.rb:220:in 'install'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:22:in 'run'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/invocation.rb:118:in 'invoke_task'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor.rb:263:in 'dispatch'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/vendor/thor/base.rb:386:in 'start'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/bin/bundle:13:in '<top (required)>'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/bin/bundle:23:in 'load'
    from /home/vivek/.rvm/gems/ruby-1.9.3-p194@global/bin/bundle:23:in '<main>'
    
por Vivek 10.05.2012 / 08:04

1 resposta

5

O tutorial a seguir recomenda a recompilação de Ruby com suporte a SSL: link

Supondo que você use o RVM, estas são as etapas a seguir para corrigir esse problema.

Instale o pacote openssl

rvm pkg install openssl

Remova a instalação do Ruby que você está usando

rvm remove 1.9.3

E finalmente recompile o Ruby com o openssl

rvm install 1.9.3 --with-openssl-dir=$HOME/.rvm/usr

Tudo deve estar funcionando agora. Não esqueça de:

rvm use 1.9.3 --default

Aqui estão mais alguns links que basicamente sugerem o mesmo:

por Sergey 10.05.2012 / 08:53