1
votes

rails -v ruby -v gem -v

all get proper answers. But when I run rails new blog, I get the following error message:

/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- openssl (LoadError)

Below is the full trace: run bundle install /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': no such file to load -- openssl (LoadError) from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /usr/local/lib/ruby/1.9.1/net/https.rb:92:in <top (required)>' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:447:inssl' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:216:in connection_for' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/vendor/net/http/persistent.rb:358:inrequest' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/fetcher.rb:135:in fetch' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/fetcher.rb:163:infetch_dependency_remote_specs' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/fetcher.rb:122:in fetch_remote_specs' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/fetcher.rb:70:inspecs' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:234:in block in remote_specs' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:232:ineach' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:232:in remote_specs' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:165:infetch_specs' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/source.rb:70:in specs' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:205:inblock (2 levels) in index' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:202:in each' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:202:inblock in index' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/index.rb:9:in build' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:198:inindex' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:192:in resolve' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:127:inspecs' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/definition.rb:122:in resolve_remotely!' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/installer.rb:48:inrun' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/installer.rb:12:in install' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/cli.rb:220:ininstall' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/vendor/thor/task.rb:22:in run' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/vendor/thor/invocation.rb:118:ininvoke_task' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/vendor/thor.rb:263:in dispatch' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/lib/bundler/vendor/thor/base.rb:386:instart' from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.1.3/bin/bundle:13:in

2
Can you please provide the output of rails -v, ruby -v and gem -vezkl
ruby -v ruby 1.9.2p180 (2011-02-18 revision 30909) [i686-linux] gem -v 1.8.21 rails -v Rails 3.2.3Yitong Zhou

2 Answers

1
votes

You can try installing libopenssl-ruby package.

sudo apt-get install libopenssl-ruby

You have to reinstall ruby after this.

0
votes

Try sudo apt-get install openssl libssl-dev - libssl-dev adds the development headers.