2010-10-25 64 views
0

我一直在使用rmagick在我的Rails應用上做了一些很酷的事情。我試着用'rails server'啓動我的項目,並且出現這個錯誤。我相信我安裝了imagemagick和rmagick,所以我不知道爲什麼我會看到這個錯誤。Rails&RMagick

/Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require': no such file to load -- RMagick (LoadError) 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/Documents/Philo/philo/lib/paperclip_processors/cropper.rb:1 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/Documents/Philo/philo/vendor/plugins/paperclip/lib/paperclip.rb:46 
    from /Users/devinross14/Documents/Philo/philo/vendor/plugins/paperclip/lib/paperclip.rb:45:in `each' 
    from /Users/devinross14/Documents/Philo/philo/vendor/plugins/paperclip/lib/paperclip.rb:45 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/Documents/Philo/philo/vendor/plugins/paperclip/lib/paperclip/railtie.rb:1 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency' 
    from /Users/devinross14/.gem/ruby/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require' 
    from /Users/devinross14/Documents/Philo/philo/vendor/plugins/paperclip/rails/init.rb:1 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/plugin.rb:81 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `instance_exec' 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `run' 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:50:in `run_initializers' 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `each' 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `run_initializers' 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:134:in `initialize!' 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in `send' 
    from /Library/Ruby/Gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in `method_missing' 
    from /Users/devinross14/Documents/Philo/philo/config/environment.rb:5 
    from /Users/devinross14/Documents/Philo/philo/config.ru:3:in `require' 
    from /Users/devinross14/Documents/Philo/philo/config.ru:3 
    from /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval' 
    from /Library/Ruby/Gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize' 
    from /Users/devinross14/Documents/Philo/philo/config.ru:1:in `new' 
    from /Users/devinross14/Documents/Philo/philo/config.ru:1 
+0

上OS試試這是你的工作嗎? – 2010-10-25 19:53:16

+1

運行命令:ruby -rRMagick -e「puts Magick :: Long_version」#什麼返回? – tinifni 2010-10-25 19:54:31

+1

這有幫助嗎? http://stackoverflow.com/questions/2662977/require-rmagick-not-working – 2010-10-25 20:09:09

回答

2

在你的environment.rb

config.gem "rmagick", :lib => "RMagick" 
+0

我包括rmagick在寶石文件(導軌3),它的工作 – devinross 2010-10-29 16:21:40

+0

啊好。在我的情況下,我使用最新的Ruby EE和CentOS 5.5的Rails 2.3。 – 2010-10-30 06:37:51

0

您應該嘗試gem install rmagick?這給了你什麼?

+0

構建原生擴展。這可能需要一段時間... 成功安裝rmagick-2.13.1 1顆寶石安裝 爲rmagick-2.13.1安裝文件裏... 沒有定義Magick_colors 沒有定義Magick_fonts 沒有定義Magick_init_formats 沒有定義Magick_limit_resource 沒有定義Magick_set_cache_threshold 沒有定義Magick_set_log_event_mask 沒有定義Magick_set_log_format 沒有定義Image_initialize 沒有定義Image_combine – devinross 2010-10-26 15:42:25

+0

這就是我從sudo gem install rmagick得到的迴應。這個好嗎? – devinross 2010-10-26 15:42:52

+0

嗡嗡聲,但這意味着rmagick安裝,你試着在控制檯上:irb,然後在紅寶石控制檯類型需要'rmagick' – 2010-10-26 15:46:04