Michael Durrant
Michael Durrant

Reputation: 96484

Heroku rails error trying to bring up console - sh: rails: not found

Trying to run the Heroku console but I am getting this following:

heroku run console
Running console attached to terminal... up, run.1
sh: console: not found

$ heroku run bash works but I seem to get a (green) bash prompt - "~ $" not a rails console! Can I get into the console from here?

fyi git push heroku v311
Everything up-to-date

Upvotes: 3

Views: 2546

Answers (5)

Ben Regenspan
Ben Regenspan

Reputation: 10548

If you're on the Bamboo stack (older stack than Cedar), try:

heroku run script/rails console

This works for me and is the command recommended in Heroku docs.

Upvotes: 3

toniowhola
toniowhola

Reputation: 81

Do this

heroku run -a my-app script/rails console

Reference: https://devcenter.heroku.com/articles/console-bamboo

Upvotes: 0

Samy Dindane
Samy Dindane

Reputation: 18706

The first error is thrown simply because the console command doesn't exist. I personally have never meet a command called console in my life.

The syntax is heroku run the_command_i_want_to_run. For example: heroku run irb or heroku run bash.

The second error: There's no Rakefile in your project root. Since heroku run rails console say that Rails wasn't found, my guess is that your project wasn't (well) deployed.
Make sure you've done git push heroku.
You may also need to check the logs: heroku logs.

Upvotes: 4

Cyrus
Cyrus

Reputation: 3717

I got confused by this too.

It's just

$ heroku run console

Upvotes: 0

Patrick Klingemann
Patrick Klingemann

Reputation: 9014

a guess:

heroku run rails console

Upvotes: 3

Related Questions