Error while installing rails `$ gem install rails`

江枫思渺然 提交于 2019-12-08 07:56:16

问题


Hi I am new to Ruby on Rails and trying to setup in my machine [Ububntu 12.04 LTS]. I successfully installed Ruby and Gem now I am getting error while installing Rails Here is my version of Ruby and Gem

$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
$ gem -v
2.1.7

Now when I try command $ sudo gem install rails or $ gem install rails

ERROR:  Could not find a valid gem 'rails' (>= 0), here is why:
      Unable to download data from https://rubygems.org/ - SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A (https://rubygems.org/latest_specs.4.8.gz)

I looked this answer and updated the ca-certificate using $ sudo update-ca-certificates but it is still not working?

Help me as I new to RoR I have no idea what to do next since I have applied all measures I could. Thank you in advanced.

EDIT: Suggest me a way I can solve this problem, incase I don't find one I will be doing it using RVM.


回答1:


Some packages may b missing. Try this.

rvm get head
rvm requirements run
rvm remove 1.9.3
rvm use 1.9.3 --install --default
gem install rails



回答2:


I had this issue and simply had to update RubyGems

gem update --system



回答3:


Most likely rubygems.org is down temporarily, try running this command to add one of the mirrors as source

gem source -a 'https://production.cf.rubygems.org'

and then run

gem install rails

There are some more mirrors available.




回答4:


Without ssl:

$gem install rails --source http://rubygems.org


来源:https://stackoverflow.com/questions/19287908/error-while-installing-rails-gem-install-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!