Rails无法找到image_magick gem [英] Rails can't find image_magick gem

查看:65
本文介绍了Rails无法找到image_magick gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用image_magick gem处理图像上传,但是Rails找不到它.

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

我使用以下命令成功安装了gem:

I have installed the gem successfully using:

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

我的模特有

require 'rubygems'
require 'mini_magick'

但是,我仍然收到错误消息:

However, I still get the error:

no such file to load -- mini_magick

我可以在environment.rb中添加一些东西以将导轨指向正确的位置吗?

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

环境信息:

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

感谢您的帮助,

推荐答案

健全性检查:宝石列表mini_magick 是否显示已安装的宝石?

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

仅注意到您有我的模特有...";将它们从模型中拉出,然后将 require 行放入environment.rb中.如果您使用的是Ruby 1.9,则不需要 require'rubygems'.

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.

这篇关于Rails无法找到image_magick gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆