当我尝试创建一个新项目($rails new first_app)时,在创建目录结构后会产生以下错误.
- ...
- ...
- create vendor/plugins/.gitkeep
- run bundle install
- /home/amit/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- openssl (LoadError)
- from /home/amit/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
- from /home/amit/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/https.rb:22:in `<top (required)>'
- ...
- ...
这是Ubuntu 10.04上的配置
- $rails -v
- Rails 3.2.1
- $rvm -v
- rvm 1.10.2 by Wayne E. Seguin <wayneeseguin@gmail.com>,Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]
- $bundle -v
- Bundler version 1.0.21
- $gem -v
- 1.8.15
请帮我解决这个问题.
解决方法
您需要将ruby与openssl支持捆绑在一起.看看
http://beginrescueend.com/packages/openssl/
rvm重新安装1.9.3 –with-openssl-dir = /usr/local
这需要您的框上有openssl头.这些在系统中的名称不同,例如libopenssl-dev,libssl-dev,openssl-devel等.