【问题标题】:heroku run rake db:migrate failed: command not foundheroku 运行 rake db:迁移失败:找不到命令
【发布时间】:2012-10-31 12:01:28
【问题描述】:

我是heroku的新手。当我执行 CS169.1x homework2(部署应用程序)时,我遇到了使用以下命令填充数据库的问题:heroku run rake db:migrate。这是终端转储:

saasbook@saasbook:~/Documents/hw2_rottenpotatoes$ git pull heroku master
From heroku.com:afternoon-cove-7289
 * branch            master     -> FETCH_HEAD
Already up-to-date.
saasbook@saasbook:~/Documents/hw2_rottenpotatoes$ git push heroku master
Everything up-to-date
saasbook@saasbook:~/Documents/hw2_rottenpotatoes$ heroku run rake db:migrate
heroku run rake db:migrate: command not found
saasbook@saasbook:~/Documents/hw2_rottenpotatoes$ 

可能有什么问题?如果heroku上有错误转储要检查?

【问题讨论】:

  • 这件事刚刚发生在我身上。似乎 rake 根本没有安装在 heroku 服务器上——尽管它之前一直在工作。所有 rake 命令都因找不到命令而失败。不同于 rake 失败,因为没有“rake aborted!”信息。切换到同一个账号下的另一个heroku应用,同样的命令成功了。

标签: ruby-on-rails heroku


【解决方案1】:

你安装了heroku gem吗?如果你在 gemfile 中有 heroku,你可能需要这样做

bundle exec heroku run...

【讨论】:

  • 不,我通过运行以下命令安装了必要的应用程序 gem:bundle install --without production
  • 你安装了heroku吗? gem install heroku 或将其添加到 Gemfile(不在生产​​部分)
【解决方案2】:

只是为了确保你安装了heroku,运行时会发生什么:

$heroku help

【讨论】:

  • 用法:heroku COMMAND [--app APP] [command-specific-options] 主要帮助主题,输入“heroku help TOPIC”了解更多详情:auth # authentication (login, logout) apps # manage应用程序(创建、销毁)等等......
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-08-05
  • 1970-01-01
  • 2015-03-25
  • 2012-02-24
  • 1970-01-01
  • 2014-02-13
相关资源
最近更新 更多