«Невозможно загрузить такой файл – openssl» при запуске пакета

Когда я пытаюсь использовать bundler , я получаю ошибку:

/home/vivek/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require ': невозможно загрузить такой файл – openssl (LoadError )

Полное сообщение об ошибке приведено ниже. Как это исправить?

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>' 

В следующем учебном пособии рекомендуется перекомпилировать Ruby с поддержкой SSL: http://www.dinduks.com/rails-cannot-load-such-file-openssl

Предполагая, что вы используете RVM, выполните следующие действия, чтобы исправить эту проблему.

Установите пакет openssl

 rvm pkg install openssl 

Удалите установку Ruby, которую вы используете.

 rvm remove 1.9.3 

И, наконец, перекомпилируйте Ruby с openssl

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

Теперь все должно работать. Не забудьте:

 rvm use 1.9.3 --default 

Вот еще несколько ссылок, которые в основном предлагают сделать то же самое: