0

我们在 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>'
4

2 回答 2

1

因此,经过将近一天的调试,结果证明是与名为 Test 的资源的名称冲突。Test是 rails 中的受限关键字。

我们没有使用该资源,因此删除与其关联的所有文件(模型、控制器、视图、助手等)解决了我们的问题。

我确信重命名资源会产生相同的效果。

于 2012-11-29T17:18:10.900 回答
0

我相信正确的命令应该是heroku run console --app teddle.

于 2012-11-28T17:56:44.407 回答