简体   繁体   English

Rails 和 Heroku:bash:rails:找不到命令

[英]Rails & Heroku: bash: rails: command not found

I am trying to get into my rails heroku database.我正在尝试进入我的 rails heroku 数据库。 Usually I just run:通常我只是运行:

heroku run rails console

but it's giving me an error: bash: rails: command not found但它给了我一个错误: 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.然后,在尝试 rails c 之前,您需要设置数据库。

heroku run rake db:migrate

I followed this devcenter.heroku: getting started with rails4我关注了这个devcenter.heroku: Getting started with rails4

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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