Ruby on rails Heroku dyno与消息app[web.1]崩溃:/usr/bin/env:ruby.exe:没有这样的文件或目录

Ruby on rails Heroku dyno与消息app[web.1]崩溃:/usr/bin/env:ruby.exe:没有这样的文件或目录,ruby-on-rails,deployment,heroku,heroku-toolbelt,Ruby On Rails,Deployment,Heroku,Heroku Toolbelt,我有一个基本的rails应用程序,它可以在我的windows 8桌面rails\u 12factor、ruby 1.9.3、rails 4和postgres上运行-使用rails服务器-我可以在本地浏览器上导航到应用程序网站,一切都很好 我通过git push heroku master将应用程序推送到heroku,一切似乎都很顺利。我看到的唯一警告是删除Gemfile.lock,因为它是在Windows上生成的。该过程以以下消息结束-正在启动。。。完成,v9 但是,在运行heroku ps时,

我有一个基本的rails应用程序,它可以在我的windows 8桌面rails\u 12factor、ruby 1.9.3、rails 4和postgres上运行-使用rails服务器-我可以在本地浏览器上导航到应用程序网站,一切都很好

我通过git push heroku master将应用程序推送到heroku,一切似乎都很顺利。我看到的唯一警告是删除Gemfile.lock,因为它是在Windows上生成的。该过程以以下消息结束-正在启动。。。完成,v9

但是,在运行heroku ps时,我得到以下信息:

===Web1X:bin/rails服务器-p$PORT-e$rails\u ENV web.1:2013/07/12 00:42:20~4s前崩溃

在执行heroku logs-tail时,我在日志文件中重复了以下内容-:

heroku[web.1]: Starting process with command `bin/rails server -p 16041 -e $RAILS_ENV`
app[web.1]: /usr/bin/env: ruby.exe: No such file or directory
heroku[web.1]: Process exited with status 127
heroku[web.1]: State changed from starting to crashed
heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
heroku[web.1]: Stopping process with SIGKILL

...

heroku[web.1]: Process exited with status 127
heroku[web.1]: Error R99 (Platform error) -> Failed to launch the dyno within 10 seconds
我在网上看到一些东西,让我检查一下。gitignore,看看本地bin文件夹的内容是否被排除。事实并非如此。我还看到了编辑bin文件夹内容和在ruby之后删除word.exe的建议——我也尝试过

编辑1:我的项目有一个子文件夹bin,包含3个文件bundle、rail和rake。这些是唯一以开头的文件/usr/bin/env ruby。我还编辑了第一行来阅读/usr/bin/env ruby*.exe*-仍然可以看到错误。以下是每个文件的内容:

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


在我看来,有些脚本试图通过一个shebang加载ruby.exe

看看你的项目/脚本/rails,我的项目在Mac OS 10.6下是这样的:

#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.

APP_PATH = File.expand_path('../../config/application',  __FILE__)
require File.expand_path('../../config/boot',  __FILE__)
require 'rails/commands'

这里有一个猜测:您在Windows上编辑了源文件,因此行尾是错误的。如果是,Linux加载程序将尝试加载ruby\n

在文件上运行dos2unix,重新提交并重新推送到Heroku。事实上,我曾经遇到过这种情况。

我的项目文件夹中没有脚本文件夹。但是,我有一个包含文件包、rails和rake的bin文件夹。他们都是从/usr/bin/env ruby:例如/usr/bin/env ruby env['BUNDLE_GEMFILE']| |=File.expand_path'../../GEMFILE',uu File_uuuu加载Gem.bin_path'bundler',BUNDLE'如果在项目文件夹中搜索ruby.exe会有什么帮助:或者:
#!/usr/bin/env ruby
require_relative '../config/boot'
require 'rake'
Rake.application.run
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.

APP_PATH = File.expand_path('../../config/application',  __FILE__)
require File.expand_path('../../config/boot',  __FILE__)
require 'rails/commands'