2015-05-27 137 views
0

我正嘗試將RoR應用程序上傳到Heroku。在Heroku上部署Ruby on Rails

操作系統 - Ubuntu,ruby版本 - 2.2.2p95,rails版本 - 4.2.1,數據庫 - PostgreSQL,通過BrightBox(教程從treehouse)安裝RoR,使用git push heroku master進行上傳。

在本地服務器應用程序工作正常。當我把它推到Heroku的,它給出了一個錯誤:

The page you were looking for doesn't exist. 
You may have mistyped the address or the page may have moved. 
If you are the application owner check the logs for more information. 

日誌文件說:

/usr/bin/env: ruby2.2: No such file or directory 

我已經嘗試了所有可能的方案,我可以在互聯網上找到:

rake rails:update:bin 

Remove bin from ~/.gitignore (But there is no such file) 

heroku config:set PATH=bin:vendor/bundle/ruby/2.2.2/bin:/usr/local/bin:/usr/bin:/bin 

Adding this to the GemFile: ruby '2.2.2' 

Changed #!/usr/bin/env ruby2.2(.2 (not sure about ".2")) to #!/usr/bin/env ruby (in bin/rake, bin/bundle and bin/rails) 

heroku run rails db:migrate 
rake rails:update:bin 

ln -s /usr/bin/nodejs /usr/bin/node 

要上傳到Heroku的,我已經配置了git的,在Heroku的後登錄,在那之後「的Heroku創建」,即「混帳推Heroku的主」後,然後在「打開的Heroku」

等等......任何想法如何解決這個問題?

回答

0

您是否安裝了gem rails12_factor和config.assets.compile = true

+0

我已經安裝了它,但它沒有改變任何東西。我不確定你寫的第二行。我在哪裏可以找到它?感謝您的答覆。 –

+0

而實際上它是rails_12factor –

+0

是的,抱歉的錯字。第二行應該在你的config/environments/production.rb文件中。 –

0

不知道你錯打了什麼或別的東西。但heroku run rails db:migrate將無法​​正常工作,應該是heroku run rake db:migrate。這可能是因爲你沒有root頁面。預編譯問題等

運行heroku logs -a app_name查看實際日誌。

+0

其實,它們都不起作用。日誌文件告訴我,上面寫過。感謝您的答覆。 –