Rake 中止,没有要加载的文件 -- paperclip

发布于 2024-11-03 05:11:43 字数 2898 浏览 0 评论 0原文

我正在尝试将 Rails3 应用程序部署到 Heroku,但是当我 rake db:create 或 rake db:migrate 到 heroku 时,出现“Rake aborted”错误。

db:push 确实发送了架构、索引和数据,但我在 app.heroku url 处收到“应用程序错误”。

我尝试删除并创建一个新的 Heroku 应用程序,但遇到了同样的问题。

回形针似乎是原因。我检查过回形针在 gemfile 中。我已经更新了所有宝石。我尝试从 gemfile 中删除明显的依赖项。但我仍然收到“耙子中止”错误。

如果有任何想法或有用信息的提示,以帮助我了解发生了什么以及如何解决它,我将不胜感激。

这是heroku db:create --trace

rake aborted!
no such file to load -- Paperclip
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/app/config/application.rb:11
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/app/Rakefile:4
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/bin/rake:31
/usr/ruby1.8.7/bin/rake:19:in `load'
/usr/ruby1.8.7/bin/rake:19
(in /app)

heroku 日志文件很长,唯一看起来相关的是

2011-04-26T02:57:28+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': no such file to load -- Paperclip (LoadError)

我的gem 文件

source 'http://rubygems.org'

gem 'rails', '3.0.5'
gem 'sqlite3'
gem 'pg', :require => 'pg'
gem 'paperclip', :require => 'paperclip'
gem 'rack-raw-upload'
gem 'rmagick'
gem 'will_paginate', '3.0.pre2'
gem 'devise'
gem 'aws-s3'
gem 'omniauth'
gem 'cancan'
gem 'cells'

group :development do
    gem 'annotate-models', '1.0.4'
    gem 'nifty-generators'
end

group :test do
    gem 'mocha'
end

在我本地的Postgres 开发环境中一切都工作正常。

如果我错过了任何重要信息,请告诉我。

我感谢任何有助于理解调试此类问题的最佳方法的指示。我不知道从哪里开始!

谢谢

I'm trying to deploy a Rails3 app to Heroku, but am getting this 'Rake aborted' error when I rake db:create or rake db:migrate to heroku.

db:push does send the schema, indexes and data, but I get an 'Application Error' at the app.heroku url.

I've tried deleting and creating a new Heroku app, but I get the same problem.

Paperclip seems to be the cause. I've checked that paperclip is in the gemfile. I've updated all gems. I tried removing obvious dependencies from the gemfile. But I still get the 'rake aborted' error.

I'd appreciate any ideas or pointers to useful information to help me understand what's going on, and how to fix it.

This is the heroku db:create --trace

rake aborted!
no such file to load -- Paperclip
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in `new_constants_in'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in `load_dependency'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require'
/app/config/application.rb:11
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
/app/Rakefile:4
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `load'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2017:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2016:in `load_rakefile'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2000:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/bin/rake:31
/usr/ruby1.8.7/bin/rake:19:in `load'
/usr/ruby1.8.7/bin/rake:19
(in /app)

The heroku log file is long, and the only bit that looks relevant is

2011-04-26T02:57:28+00:00 app[web.1]: /app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in `require': no such file to load -- Paperclip (LoadError)

My gem file

source 'http://rubygems.org'

gem 'rails', '3.0.5'
gem 'sqlite3'
gem 'pg', :require => 'pg'
gem 'paperclip', :require => 'paperclip'
gem 'rack-raw-upload'
gem 'rmagick'
gem 'will_paginate', '3.0.pre2'
gem 'devise'
gem 'aws-s3'
gem 'omniauth'
gem 'cancan'
gem 'cells'

group :development do
    gem 'annotate-models', '1.0.4'
    gem 'nifty-generators'
end

group :test do
    gem 'mocha'
end

Everything is working fine in my local Postgres dev environment.

Please let me know if I have missed any important info.

I appreciate any pointers that would help understand the best approach to debugging an issue like this. I'm lost as to where to start!

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

内心荒芜 2024-11-10 05:11:43

经过大量搜索,答案就在 application.rb 文件中。我有一行“需要回形针”,我删除了它,一切正常。

After a lot of searching, the answer to this was in the application.rb file. I had a line "require Paperclip", which i deleted and everything worked fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文