在脚本中需要时找不到rmagick gem

时间:2021-10-12 08:57:40

I've recently run into an issue with mod_passenger and gems. I have a couple of gems install and I can find them in my /opt/ruby-enterprise/lib/ruby/gems/1.8/gems directory. One is will_paginate and the other is rmagick.

我最近遇到了mod_passenger和gem的问题。我有几个宝石安装,我可以在我的/opt/ruby-enterprise/lib/ruby/gems/1.8/gems目录中找到它们。一个是will_paginate,另一个是rmagick。

For some reason, when my rails app starts up, it finds will_paginate just fine, but says it can't find rmagick. I have even tried doing this in the script/console by typing in require 'will_paginate' and require 'rmagick'. will_paginate loads, rmagick errors out saying "MissingSourceFile: no such file to load -- rmagick"

出于某种原因,当我的rails应用程序启动时,它发现will_paginate就好了,但是说它找不到rmagick。我甚至尝试在脚本/控制台中输入require'will_paginate'并要求'rmagick'。 will_paginate加载,rmagick错误说“MissingSourceFile:没有这样的文件加载 - rmagick”

I've tried reinstalling the gem but that does not fix the issue. I've tried restarting apache. That doesn't fix the issue... Any other things I can do to figure out why it's not find that particular gem?

我已经尝试重新安装gem,但这并没有解决问题。我试过重启apache。这不能解决这个问题......我能做些什么来弄清楚为什么它找不到那个特定的宝石?

1 个解决方案

#1


3  

Duh... I wasn't requiring 'RMagick'. I didn't realize it was case sensitive.

呃......我不要求'RMagick'。我没有意识到它是区分大小写的。

require 'RMagick'

#1


3  

Duh... I wasn't requiring 'RMagick'. I didn't realize it was case sensitive.

呃......我不要求'RMagick'。我没有意识到它是区分大小写的。

require 'RMagick'