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

喜你入骨 提交于 2019-11-29 18:04:08

问题


i get the above error, all i did was install rvm and update to ruby 1.9.2 from the default ruby that you get with mac.

all my gems appear in the gem list but do i need to specify a path somewhere?

cheers,

glenno.


回答1:


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.




回答2:


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




回答3:


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'



来源:https://stackoverflow.com/questions/7117066/custom-require-rb36in-require-no-such-file-to-load-myapploaderror

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