Heroku:"Process exited with status 127" 部署 ruby 应用程序后

Heroku: "Process exited with status 127" after deploying ruby app

将一些更改部署到 Heroku 后,出现以下错误(即使我恢复更改)。

» heroku web.1 - - Starting process with command `bin/rails server -p 59617 -e production`
» app web.1 - - /usr/bin/env: ruby : No such file or directory
» heroku web.1 - - Process exited with status 127
» heroku web.1 - - State changed from starting to crashed

似乎我的应用程序不再理解 ruby。这些是我在 /bin 中的文件:

捆绑

#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
load Gem.bin_path('bundler', 'bundle')

rails

#!/usr/bin/env ruby
APP_PATH = File.expand_path('../../config/application',  __FILE__)
require_relative '../config/boot'
require 'rails/commands'

#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run

heroku 运行 "gem env"

在尝试不同的解决方案几个小时后,这是唯一对我有用的方法:

rake rails:update:bin

并将更改再次推送到 Heroku。