Cannot load files using require

喜欢而已 提交于 2019-12-06 08:03:09
Daniël W. Crompton

I had this problem today too when upgrading to >= 1.9, I was given this article to read: "Upgrading From REE 1.8.7 to Ruby 1.9.3"

The relevant portion of your question, as mentioned in your comment:

but programs in which i dont use any gems, but just other files made by myself, gives me the same result

From the article1

Load Paths:

In Ruby 1.9.3, LOAD_PATH no longer includes “.” because it was deemed a security risk. You can explicitly add it when requiring files, use absolute paths, or use require_relative.

Did you also install the gems?

Ruby 2.0 is a complete new installation. Installing ruby 2.0 does not mean you keep the installed gems.

This is not Ruby 2.0 specific. As far as I know each new ruby installation has its own gems.

There are tools to administrate diffferent rubies:

  • rvm (ruby version manager)
  • pik for windows

Probably the libraries you were using are located under the directory for Ruby 1.8. I think it is a good idea to freshly reinstall the required libraries under Ruby 2.0.

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