2016-09-19 63 views
0

我的目標實現Scrivito測試應用程序並將其部署到Heroku的。我能夠成功地推送到Heroku,但是當我打開Heroku應用程序時,在我的Heroku日誌中收到以下錯誤。Heroku的應用程序不啓動(沒有這樣的文件或目錄/ usr/bin中/ ENV:紅寶石),Unbuntu

2016-09-19T18:02:37.970943+00:00 heroku[web.1]: State changed from crashed to starting 
2016-09-19T18:02:43.815636+00:00 heroku[web.1]: Starting process with command "bin/rails server -p 44169 -e production" : No such file or directory00:00 app[web.1]: /usr/bin/env: ruby 
2016-09-19T18:02:45.897524+00:00 heroku[web.1]: Process exited with status 127 
2016-09-19T18:02:45.913351+00:00 heroku[web.1]: State changed from starting to crashed 
2016-09-19T18:21:39.994431+00:00 heroku[api]: Release v10 created by [email protected] 
2016-09-19T18:21:39.994242+00:00 heroku[api]: Deploy 72a4fb2 by [email protected] 
2016-09-19T18:21:40.329657+00:00 heroku[web.1]: State changed from crashed to starting 
2016-09-19T18:21:40.846263+00:00 heroku[slug-compiler]: Slug compilation started 
2016-09-19T18:21:40.846272+00:00 heroku[slug-compiler]: Slug compilation finished 
2016-09-19T18:21:52.697002+00:00 heroku[web.1]: Starting process with command "bin/rails server -p 5064 -e production": No such file or directory00:00 app[web.1]: /usr/bin/env: ruby 
2016-09-19T18:21:54.219622+00:00 heroku[web.1]: Process exited with status 127 
2016-09-19T18:21:54.249853+00:00 heroku[web.1]: State changed from starting to crashed 
2016-09-19T18:21:54.250802+00:00 heroku[web.1]: State changed from crashed to starting 
2016-09-19T18:21:59.216745+00:00 heroku[web.1]: Starting process with command "bin/rails server -p 17564 -e production": No such file or directory00:00 app[web.1]: /usr/bin/env: ruby 
2016-09-19T18:22:01.412414+00:00 heroku[web.1]: Process exited with status 127 
2016-09-19T18:22:01.457536+00:00 heroku[web.1]: State changed from starting to crashed 
2016-09-19T18:22:02.108887+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=scrivitoexampleapp.herokuapp.com request_id=b46afd2a-7fc1-462f-acd5-876551be1aa3 fwd="70.171.137.175" dyno= connect= service= status=503 bytes= 
2016-09-19T18:22:02.400312+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=scrivitoexampleapp.herokuapp.com request_id=d5321dcc-56f0-474a-a7c3-8ff420ad851b fwd="70.171.137.175" dyno= connect= service= status=503 bytes= 

「USR /斌/ env的紅寶石」 的四個文件被發現在我的應用程序:

​​

我的Gemfile:

source 'https://rubygems.org' 
ruby "2.3.0" 

gem 'autoprefixer-rails' 
gem 'bootstrap-sass' 
gem 'dotenv-rails' 
gem 'jbuilder', '~> 2.0' 
gem 'jquery-rails' 
gem 'rails', '4.2.6' 
gem 'sass-rails', '~> 5.0' 
gem 'scrivito', '1.5.1' 
gem 'scrivito_advanced_editors' 
gem 'secure_headers' 
gem 'uglifier', '>= 1.3.0' 

group :development do 
    gem 'web-console' 
    gem 'listen', '~> 3.0.5' 
end 

group :production do 
    gem 'pg' 
    gem 'rails_12factor' 
end` 

我在Windows 10上運行的Ubuntu 14.04。

我想知道,如果這是與事實,我最近更新到Rails 5做的,但Scrivito尚不支持它。我推送到Heroku,無論是否有指定的Ruby版本,都認爲這是問題所在。關於這個話題的其他問題似乎沒有解決我的問題。

在此先感謝!

+0

**更新:** 我推一個更新的Gemfile到現在的Heroku,其中包括紅寶石2.3.1。 當我運行'heroku run「ruby -v」'我收到結果:'ruby 2.3.1p112(2016-04-26 revision 54768)[x86_64-linux]'。 Heroku中仍然出現錯誤。 – lltheis

回答

0

嘗試切換到ruby 2.3.1和運行heroku run "ruby -v"確保版本匹配。

+0

對不起,@ cema-sp,我對這一切都很新穎 - 你能否澄清我如何切換到ruby 2.3.1?我現在已經安裝了它(我沒有意識到Ruby不會使用'bundle update'自動更新。 – lltheis

+0

你可以使用[rbenv](https://github.com/rbenv/rbenv),它很容易安裝和使用。捆紮機只更新寶石。 無論如何,嘗試運行'Heroku上運行「紅寶石-v」'你的Heroku項目目錄,檢查服務器上的紅寶石版本,它應該是2.3.1 AFAIK。 –

1

我發現了問題,這一切是在我的Windows /流浪的環境,在bin文件夾換行符進行混合。我跑了rake rails:update:bin並推動了所有的變化,在Heroku上運行!

0

我試過這個命令和固定這個問題對我來說

$ dos2unix bin/bundle bin/rake bin/rails 
相關問題