【问题标题】:heroku run rake db:migrate error for rails and mysql projectheroku 运行 rake db:rails 和 mysql 项目的迁移错误
【发布时间】:2015-04-20 02:36:54
【问题描述】:

我有一个带有 rails 4.2 和 mysql 数据库的项目。但是当我做heroku run rake db:migrate 结果是:

Running `rake db:migrate` attached to terminal... up, run.1461
/usr/bin/env: ruby2.2: No such file or directory

我的 .gitignore 中没有 bin。

在我的 heroku 日志中我有两个错误:

heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=serene-ocean-1351.herokuapp.com request_id=a40f485d-e55e-4246-b863-a8b13a3b89fa fwd="199.189.106.136" dyno= connect= service= status=503 bytes=
heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=serene-ocean-1351.herokuapp.com request_id=3404e956-71db-4530-be1f-ce6f3f23a857 fwd="199.189.106.136" dyno= connect= service= status=503 bytes=

【问题讨论】:

标签: ruby-on-rails heroku


【解决方案1】:

如果您刚刚升级到 Rails 4,请尝试以下方法来更新 Heroku 的二进制文件以支持您的命令。

$ heroku run rake rails:update:bin --app serene-ocean-1351

【讨论】:

    【解决方案2】:

    在项目的bin目录下查找文件,第一行会是

    #!/usr/bin/env ruby2.2
    

    您只需将其更改为

    #!/usr/bin/env ruby
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-16
      • 2012-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-13
      • 2023-03-04
      • 1970-01-01
      相关资源
      最近更新 更多