Paperclip Error: uninitialized constant Paperclip (NameError)

依然范特西╮ 提交于 2019-12-22 08:17:47

问题


Trying to install paperclip (the cloudfiles fork), but getting an error:

 config/enviroments/development.rb:28:in 'block in <top (required)>': uninitialized constant Paperclip (NameError)

This is how I installed everything.

gemfile:

gem 'cloudfiles', '>=1.4.9'
gem 'paperclip-cloudfiles', '~>2.3'

config/environment.rb

config.gem 'paperclip-cloudfiles', :lib => 'paperclip'

config/enviroments/development.rb

Paperclip.options[:command_path] = "/ImageMagick/6.6.9-Q16/" #ImageMagick is at c:/ImageMagick/..

回答1:


I'm not sure if this will solve your problem, but if you're using Bundler, you don't need to call config.gem in your environment.rb. Maybe instead you should do:

gem 'paperclip-cloudfiles', '~>2.3', :require => 'paperclip'



回答2:


In your gemfile you could try:

gem 'paperclip', :git => "git://github.com/minter/paperclip.git"

As Jack Chu stated you shouldn't need to list the gem in your environment.rb



来源:https://stackoverflow.com/questions/6062970/paperclip-error-uninitialized-constant-paperclip-nameerror

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