custom_require.rb:36:in `require': no such file to load — myapp(LoadError)

我与影子孤独终老i 提交于 2019-11-30 12:46:51

Check that you have the gems installed gem list If not, install as usual gem install whatever or if you want a specific version gem install whatever -v 1.2.3 Or if you have bundler in your project (ie Rails), it's just bundle install

If you have all the gems, then this is probably a local file, and you're probably coming from Ruby version < 1.9, you need to either fix your $LOAD_PATH (which will depend on too many factors for me to explain here), or specify the full path to the file you want File.dirname(__FILE__) + '/myapp'

Otherwise, you need to give more info, like what version you used to be running, what myapp is, and where it is in relation to your file.

In my case it was rvm issue, I was using rvm 1.9 when i changed it to 1.8, migration worked.

rvm use 1.8

In my case I was converting to Cygwin64. The Cygwin directory name changed and Ruby upgraded to 1.9. After I fixed the Cygwin directory name, the second solution worked. Or at least got past this problem:

require File.dirname(FILE) + '/myapp.rb'

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