no such file to load — yet file is config.gem in environtment.rb file in rails

北战南征 提交于 2020-01-03 06:18:07

问题


I keep getting this error for different gems, the most recent is acts_as_reportable:

no such file to load -- acts_as_reportable

However, I have the following line in my environment.rb:

config.gem 'acts_as_reportable'

And I also ran the following:

>gem install acts_as_reportable

It it output:

>gem install acts_as_reportable
Successfully installed acts_as_reportable-1.1.1
1 gem installed
Installing ri documentation for acts_as_reportable-1.1.1...
Installing RDoc documentation for acts_as_reportable-1.1.1...

What do I need to do?


回答1:


config.gem 'acts_as_reportable', :lib => 'ruport/acts_as_reportable'

Found the correct require in the Ruport documentation here. Explanation of the :lib option in the Rails API here.



来源:https://stackoverflow.com/questions/3050366/no-such-file-to-load-yet-file-is-config-gem-in-environtment-rb-file-in-rails

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