我正在尝试将我的应用程序放在Heroku上,但是当我运行heroku rake db:migrate时,我得到以下错误。似乎event_calendar gem导致了问题,但问题是,我已经卸载了它。 gemfile或gemfile.lock中没有对它的引用,并且它没有显示在gem列表中。尝试gem list -d event_calendar只返回 * LOCAL GEMS * ,据我所知,所有与event_calendar相关的文件都已被删除。为什么Heroku似乎还有问题?
rake aborted!
undefined method `id' for class `EventCalendar::Event'
/app/.bundle/gems/ruby/1.9.1/gems/event_calendar-0.0.2/lib/event_calendar/event.
rb:7:in `undef_method'
/app/.bundle/gems/ruby/1.9.1/gems/event_calendar-0.0.2/lib/event_calendar/event.
rb:7:in `<class:Event>'
/app/.bundle/gems/ruby/1.9.1/gems/event_calendar-0.0.2/lib/event_calendar/event.
rb:5:in `<class:EventCalendar>'
/app/.bundle/gems/ruby/1.9.1/gems/event_calendar-0.0.2/lib/event_calendar/event.
rb:1:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/depende
ncies.rb:239:in `require'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/depende
ncies.rb:239:in `block in require'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/depende
ncies.rb:225:in `block in load_dependency'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/depende
ncies.rb:596:in `new_constants_in'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/depende
ncies.rb:225:in `load_dependency'
/app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.9/lib/active_support/depende
ncies.rb:239:in `require'
/app/.bundle/gems/ruby/1.9.1/gems/event_calendar-0.0.2/lib/event_calendar.rb:4:i
n `<top (required)>'
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:
in `require'
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:
in `block (2 levels) in require'
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:
in `each'
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:
in `block in require'
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:
in `each'
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:
in `require'
/usr/ruby1.9.2/lib/ruby/gems/1.9.1/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
/app/config/application.rb:7:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/app/Rakefile:4:in `<top (required)>'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/ruby1.9.2/bin/rake:31:in `<main>'
答案 0 :(得分:0)
所以我在等待期间向Heroku发送了一张支持票,结果发现Gemfile没有被推送到Heroku,我使用git的方式出现了问题,并且推出了旧版本。一旦我正确地更新了我的git分支并推送到Heroku就可以了。