我们在Heroku的竹堆上运行了一个rails 3.0应用程序。我们最近使用常规heroku console --app name
运行控制台会话时遇到了问题。它会连接但是然后尝试任何查询都会导致内部服务器错误。
我们收到了弃用警告以下载Heroku Toolbelt。我这样做了,在本地安装,然后尝试使用heroku run --app teddle rails console
启动控制台,但出现以下错误。
知道可能出现什么问题吗?
Juless-MacBook-Air:teddle julescoleman$ heroku run --app teddle rails console
Running `rails console` attached to terminal... up, run.2038
** [NewRelic][11/28/12 16:46:33 +0000 ab2e4817-034e-47a8-a641-b65004bab257 (2)] INFO : Dispatcher: thin
** [NewRelic][11/28/12 16:46:33 +0000 ab2e4817-034e-47a8-a641-b65004bab257 (2)] INFO : Application: teddle
** [NewRelic][11/28/12 16:46:33 +0000 ab2e4817-034e-47a8-a641-b65004bab257 (2)] INFO : New Relic Ruby Agent 3.4.1 Initialized: pid = 2
Connected to NewRelic Service at collector-2.newrelic.com
** [NewRelic][11/28/12 16:46:43 +0000 ab2e4817-034e-47a8-a641-b65004bab257 (2)] INFO : Reporting performance data every 60 seconds.
/usr/ruby1.9.2/lib/ruby/1.9.1/test/unit/assertions.rb:4:in `<top (required)>': Test is not a module (TypeError)
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:227:in `load_dependency'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /usr/ruby1.9.2/lib/ruby/1.9.1/test/unit/testcase.rb:1:in `<top (required)>'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:227:in `load_dependency'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/test_case.rb:1:in `<top (required)>'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:227:in `load_dependency'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.11/lib/rails/console/app.rb:2:in `<top (required)>'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `block in require'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:227:in `load_dependency'
from /app/.bundle/gems/ruby/1.9.1/gems/activesupport-3.0.11/lib/active_support/dependencies.rb:239:in `require'
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.11/lib/rails/application.rb:227:in `initialize_console'
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.11/lib/rails/application.rb:153:in `load_console'
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.11/lib/rails/commands/console.rb:26:in `start'
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.11/lib/rails/commands/console.rb:8:in `start'
from /app/.bundle/gems/ruby/1.9.1/gems/railties-3.0.11/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
答案 0 :(得分:1)
因此,经过近一天的调试,答案结果证明是与名为Test的资源的名称冲突。 Test
是rails中的受限制关键字。
我们没有使用该资源,因此删除与其关联的所有文件(模型,控制器,视图,帮助器等)解决了我们的问题。
我确信重命名资源会产生同样的效果。
答案 1 :(得分:0)
我认为正确的命令应该是heroku run console --app teddle
。