Rails can't find image_magick gem

夙愿已清 提交于 2019-12-24 07:24:07

问题


I am trying to use image_magick gem to process image uploads, but rails can't locate it.

I have installed the gem successfully using:

gem install mini_magick-1.2.3.gem --local
gem update system
gem cleanup

and my model has

require 'rubygems'
require 'mini_magick'

However, I still get the error:

no such file to load -- mini_magick

Can I add something to the environment.rb to point rails to the correct location?

Environment information:

Windows XP/InstantRails 2.0 
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
Rails 2.3.2

Thanks for the help,


回答1:


Sanity check: does gem list mini_magick show the gem as installed?

Edit:

Just noticed that you have 'my model has...'; pull them out of the Model, and put the require lines into environment.rb. You don't need require 'rubygems' if you're using Ruby 1.9.



来源:https://stackoverflow.com/questions/753383/rails-cant-find-image-magick-gem

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