开发者

Rake aborted, no such file to load -- paperclip

开发者 https://www.devze.com 2023-02-28 21:35 出处:网络
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.

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消