`require': cannot load such file — rubygems.rb when installing ruby and rubygems with rvm

牧云@^-^@ 提交于 2019-12-23 03:23:05

问题


I was trying to create a fresh installation of Ruby and Rubygems using RVM on Ubuntu 13.10. I had already had an installation before which somehow got corrupted. I decided to reinstall everything, so I ran

rvm implode

which seemed to delete all traces of ruby and rubygems.

However, after reinstalling it using

\curl -L https://get.rvm.io | bash -s stable --ruby
source /home/<username>/.rvm/scripts/rvm

when I run gem install rails, i get the following error:

<internal:gem_prelude>:1:in `require': cannot load such file -- rubygems.rb (LoadError)from <internal:gem_prelude>:1:in `<compiled>'

What's the problem here?


回答1:


It turns out that my problem was the fact that I had created a symbolic link to gem manually in /usr/bin. After deleting the symbolic link, I reinstalled everything using the following commands:

rvm implode
\curl -L https://get.rvm.io | bash -s stable --ruby
source /home/<username>/.rvm/scripts/rvm

after which

gem install rails

worked like a charm.



来源:https://stackoverflow.com/questions/23202620/require-cannot-load-such-file-rubygems-rb-when-installing-ruby-and-rubygem

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