rails: heroku run console giving error "bash: console: command not found" - ruby-on-rails

Using the cedar-14 stack on Heroku. Just noticed that I can no longer run heroku run console because I get the error:
bash: console: command not found
I can still get to the console by calling:
heroku run bundle exec rails console
But I'm wondering what might have caused this change. I only noticed the issue after several days of commits so I can pinpoint the issue.

You need to use
heroku run rails console
The Basics for Heroku are explained under Heroku Devcenter.

Try
heroku run /app/bin/rails console
I happened to see this problem for a preview apps. For regular apps heroku console works.

I run into the same problem but I have resolved it by removing heroku/metrics build pack.
I have followed the configuration given for Ruby Language Metrics https://devcenter.heroku.com/articles/language-runtime-metrics-ruby and then tried to run the command heroku run console and it was triggering command not found error then I have reverted my changes and it started working.
Hope this will be helpful!

Related

Loggin an Heroku app through heroku run rails console

I want to get more detailed logs of my company app.
To do this I have read I can use "heroku run rails console" command.
When I launch it pointing to my remote app, I get:
/bin/bash: rails: command not found
Do I need to install something on my remote app?
Thank you for the help

"bash: rails: command not found" on heroku even though rails is installed

I created a new heroku app, pushed the code, it was recognized as a rails app, and heroku started running the migrations. This lead to an error, and so I tried to run:
heroku run rails db:reset --remote staging
However, even though rails was obviously installed, I got this error:
bash: rails: command not found
I also tried replacing rails with /app/bin/rails, which didn't work either.

Unable to deploy rails test app to Heroku

I'm working through the odin project's web development course and I'm getting tripped up on the last part of the installations project where you are tasked with deploying a rails app to Heroku. I've been working on this for about a week but I refuse to give up but I realize that I need some help.
Here's the link to the tutorial I'm trying to work through (on a mac):
http://installfest.railsbridge.org/installfest/deploy_a_rails_app
I have a Heroku account set up, and am running Ruby 2.3.0 and rails 4.2.5.1. Rubygems are at 2.6.1 (but I tried them at 2.5.1 too).
Everything works fine but when I get to heroku run rake db:migrate I always get the time out error:
[~/railsbridge/test_app] ruby-2.3.0 $ git push heroku master
Everything up-to-date
[~/railsbridge/test_app] ruby-2.3.0 $ heroku run rake db:migrate
Running rake db:migrate on powerful-journey-35824... up, run.9421
▸ ETIMEDOUT: connect ETIMEDOUT 50.19.103.36:5000
I saw another post suggesting that the problem is a result of the connection I'm using blocking port 5000 (I'm at a library). I checked port 5000 on canyouseeme.org as well but it also timed out.
I then tried deploying the app detached using heroku run:detached rake db:migrate and it seems to work until I open heroku again and it shows that the page I'm looking for doesn't exist.
Basically what I'm asking is, does anyone have any idea why this test app isn't getting pushed from my terminal to the heroku deployment page?
I'm a python/django guy, but taking a guess the "everything up to date" message is likely because you have not commited your changes to git. Try:
git commit -a
git push heroku master
Now run your rake command.

rake db:migrate bundle: command not found

I'm using Heroku and cloud9.io for my app.
I get the Error:
bash: bundle: command not found
When i try run the command:
heroku run rake db:migrate
Localy my app works fine without any error but i'm not able to migrate and i get the Application on herokuapp.com path.
Your problem may be due to the version of Ruby you are running.
I had a similar issue before, I tried everything possible(installing bundler, etc.), but one thing that worked for me was to manually set the config using following command:
heroku config:add GEM_PATH=vendor/bundle/1.8
Please note that you should change 1.8 to the version of Ruby you are currently running.

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
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.
a guess:
heroku run rails console
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.
I got confused by this too.
It's just
$ heroku run console
Do this
heroku run -a my-app script/rails console
Reference: https://devcenter.heroku.com/articles/console-bamboo

Resources