1

私の Windows 8 デスクトップ (rails_12factor、ruby 1.9.3、rails 4、postgres) で動作する基本的な Rails アプリケーションがありますrails server

アプリケーションをheroku経由でプッシュするgit push heroku masterと、すべてうまくいくようです。表示される唯一の警告は、「Gemfile.lockWindows で生成されたため削除しています」です。プロセスは次のメッセージで終了します - 「Launching... done, v9」。

ただし、「heroku ps」を実行すると、次のようになります。

=== web (1X): bin/rails server -p $PORT -e $RAILS_ENV web.1: クラッシュしました 2013/07/12 00:42:20 (~ 4 秒前)

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

Web で .gitignore をチェックして、ローカルの bin フォルダーの内容が除外されているかどうかを確認するものを見ました。ではない。また、bin フォルダーの内容を編集し、ruby の後にある .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')

レール

#!/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
4

2 に答える 2

0

一部のスクリプトがruby.exeシバンを介してロードしようとしているようです。

を見てくださいyourproject/script/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'
于 2013-07-13T04:17:58.170 に答える
0

ここでの推測: Windows でソース ファイルを編集したため、行末が間違っています。そうである場合、Linux ローダーは「ruby\n」をロードしようとします。

ファイルに対して dos2unix を実行し、再コミットして Heroku に再プッシュします。それは実際に私に一度起こりました。

于 2013-07-13T17:50:32.183 に答える