Ruby gem install and “No such file to load”

雨燕双飞 提交于 2019-12-03 08:03:35

Try to require 'rubygems' before the rest of your gems requirements.

rubygems is actually redefining the Kernel#require method to look for gems on your gempath. Whitout it ruby will just look for local/on path files.

It took me a lot but now I know how to fix it. It's about GEM_PATH.

# echo "export GEM_PATH=/var/lib/gems/1.9.2/" >> ~/.bashrc 
# source ~/.bashrc

Now if I run irb:

# irb 
irb(main):003:0> require 'htmlentities'
=> true
irb(main):004:0>

WOOT!

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