0

We have a rails 3.0 app running on Heroku's bamboo stack. We had been having trouble running a console session using the regular heroku console --app name recently. It would connect but then trying any query would result in an Internal Server Error.

We were getting deprecation warnings to download Heroku Toolbelt. I did that, installed locally and then tried to launch a console using heroku run --app teddle rails console but get the following errors.

Any idea what could be wrong?

    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>'
julesie
  • 104
  • 4

2 Answers2

1

So after almost a day of debugging the answer turned out to be a name clash with a resource named Test. Test is a restricted keyword in rails.

We weren't using the resource, so deleting all files associated with it (model, controller, views, helpers, etc.) solved our problem.

I'm sure renaming the resource would have had the same effect.

julesie
  • 104
  • 4
0

I believe the correct command should be heroku run console --app teddle.

Benjamin Tan Wei Hao
  • 9,621
  • 3
  • 30
  • 56
  • For bamboo stack apps that command results in an error. `heroku run console --app teddle Running `console` attached to terminal... up, run.7756 bash: console: command not found` – julesie Nov 28 '12 at 17:59
  • See this question for further detail. http://stackoverflow.com/questions/8941659/running-heroku-console-does-not-start – julesie Nov 28 '12 at 18:02