简体   繁体   中英

Rails & Heroku: bash: rails: command not found

I am trying to get into my rails heroku database. Usually I just run:

heroku run rails console

but it's giving me an error: bash: rails: command not found

I have no idea what caused this. Haven't updated my project code.

heroku --version
heroku-toolbelt/3.36.5 (x86_64-darwin15) ruby/2.2.4
heroku-cli/5.6.14-b0cc983 (darwin-amd64) go1.7.4
=== Installed Plugins
heroku-redis@1.2.8

The same happened to me. My problem was that I didn't commit my changes before the first push, so I didn't have the project up. I did:

git add .
git commit -m "first commit"
git push origin heroku

then, before trying rails c, you need to setup the database.

heroku run rake db:migrate

I followed this devcenter.heroku: getting started with rails4

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM