Heroku rake db:迁移中止;实习空字符串......为什么?

时间:2011-04-07 19:06:52

标签: database ruby-on-rails-3 heroku rake

好的我已经尝试在这个网站上搜索其他类似的问题,但那些接近的人没有答案,所以希望rails / heroku guru可以帮助我。

我已经创建了一个基本的rails应用程序(我正在学习),并设法让它在我的家用机器上完美运行。但当我把它推到Heroku并输入:

heroku rake db:migrate我收到以下错误:

c:\iltapp>heroku rake db:migrate --trace
rake aborted!
interning empty string
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1309:in `to_sym'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1309:in `action_path'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1304:in `path_for_action'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1159:in `match'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:1360:in `match'
/app/config/routes.rb:11
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
/app/.bundle/gems/ruby/1.8/gems/actionpack-3.0.5/lib/action_dispatch/routing/route_set.rb:233:in `draw'
/app/config/routes.rb:1
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:227:in `load_dependency'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:235:in `load'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:127:in `reload_routes!'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:127:in `each'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:127:in `reload_routes!'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:120:in `routes_reloader'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/file_update_checker.rb:32:in `call'
/app/.bundle/gems/ruby/1.8/gems/activesupport-3.0.5/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:51
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:52:in `call'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application/finisher.rb:52
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `instance_exec'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:25:in `run'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:50:in `run_initializers'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `each'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/initializable.rb:49:in `run_initializers'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:134:in `initialize!'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `send'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/app/config/environment.rb:5
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:103:in `require'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:103:in `require_environment!'
/app/.bundle/gems/ruby/1.8/gems/railties-3.0.5/lib/rails/application.rb:216:in `initialize_tasks'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/usr/ruby1.8.7/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/usr/ruby1.8.7/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/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:2023:in `top_level'
/app/.bundle/gems/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001: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)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment

很抱歉长粘贴,但说实话,我不知道哪一部分可能是我提供的信息。我注意到了什么,我希望不是这样的,我有Ruby 1.9.2& Rails 3已安装,我看到heroku在上面提到了1.8。如果我继续使用我的版本,或者如果这是问题,我的代码是否会与heroku完全不兼容?有没有办法绕过它?

更新#1:我尝试了@Svilen建议使用herolu rake db:reset重置数据库并获得相同的错误和一些新错误,这可能与也可能没有关系。并澄清我在 Bamboo Stack(bamboo-ree-1.8.7)上运行它继承人我得到的:

Couldn't drop hvjiqvwyxn : #<ActiveRecord::StatementInvalid: PGError: ERROR:  must be owner of database hvjiqvwyxn
: DROP DATABASE IF EXISTS "hvjiqvwyxn">
hvjiqvwyxn already exists
rake aborted!
interning empty string

更新#2:根据@ Svilen提到的堆栈,我已经迁移到 bamboo-mri-1.9.2 ,其中ruby 1.9.2(并纠正我,如果我错了)支持“实习空字符串”

任何答案都会非常感激。

1 个答案:

答案 0 :(得分:1)

Heroku仅在Bamboo堆栈上支持Ruby 1.9.2。您可以通过键入 heroku stack 来检查您正在使用的堆栈。如果你是旧的 - 阿斯彭 - 你可以很容易地搬到竹子。在Heroku的开发中心查看这篇文章:http://devcenter.heroku.com/articles/stack

如果情况并非如此,请尝试使用 heroku rake db:reset 重置数据库并强制进行所有迁移(注意:您将丢失所有现有数据!)。您也可以尝试使用 heroku restart 重新启动Heroku。

如果您在git推送到heroku期间发现任何奇怪的内容,则可能与问题相关,并且值得使用其他数据更新您的问题。