回形针错误:未初始化的常量回形针(NameError)
尝试安装回形针(cloudfiles 分支),但出现错误:
config/enviroments/development.rb:28:in 'block in <top (required)>': uninitialized constant Paperclip (NameError)
这就是我安装所有内容的方式。
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/..
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/..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定这是否能解决您的问题,但如果您使用 Bundler,则不需要在environment.rb 中调用 config.gem。也许你应该这样做:
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:
在您的 gemfile 中,您可以尝试:
正如 Jack Chu 所说,您不需要在您的环境中列出 gem。
In your gemfile you could try:
As Jack Chu stated you shouldn't need to list the gem in your environment.rb