本文介绍了回形针错误:未初始化的常量回形针(NameError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试安装回形针(cloudfiles fork),但出现错误:

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.

宝石文件:

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

config/environment.rb

config/environment.rb

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

config/enviroments/development.rb

config/enviroments/development.rb

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

推荐答案

我不确定这是否能解决您的问题,但如果您使用 Bundler,则无需在您的环境中调用 config.gem.rb也许你应该这样做:

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'

这篇关于回形针错误:未初始化的常量回形针(NameError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 02:59