2013-02-13 104 views
1

我已經爲root創建了一個自定義頁面,並在routes.rb中進行了相應更改。在使用git之前,我已經刪除了public/index.html文件,但該應用仍在尋找public/index。在heroku.The應用HTML文件本地工作正常,但問題是,而在heroku.Please部署提出了一些解決方法嗎?我的Gemfile包含Rails在本地正常工作,但不在heroku

source 'https://rubygems.org' 
gem 'rails', '3.2.11' 
group :development do 
    gem 'sqlite3', '1.3.5' 
end 
group :assets do 
    gem 'sass-rails','3.2.4' 
    gem 'coffee-rails', '3.2.2' 
    gem 'uglifier', '1.2.3' 
end 
gem 'jquery-rails' 
gem 'thin' 

,我沒有使用數據庫,我app.The控制器只是做一些計算在json字符串上。

+0

你提交更改推送到Heroku的之前的git?你編輯你的routes.rb並設置'root:to =>「something」'? – tmaximini 2013-02-13 10:02:23

+0

是的,但我仍然得到500錯誤 – zoro 2013-02-13 16:54:46

+0

Heroku日誌顯示此錯誤在=信息方法= GET路徑= /主機= guarded-atoll-1158.herokuapp.com fwd = 117.204.119.60 dyno = web.1隊列= 0等待= 0ms連接= 7ms服務= 1583ms狀態= 500字節= 643 – zoro 2013-02-15 04:57:41

回答

4

我相信你已經使用:

git add . 
git commit -m "blabla" 

然而,git add .不看刪除的文件,所以public/index.html仍然存在。

您必須使用git add -u來包含已刪除的文件。

或者,您可以使用git add -A,這相當於git add .git add -u

編輯 - 逐步與評論:

git add -A    #add everything (including deleted files) 
git commit -m "blabla" #commit it 
git push     #push from your pc to your git repository 
git push heroku   #push from your git repository to heroku 

如果你刪除了文件public/index.html它必須工作。

編輯以下內容添加到您的Gemfile:

group :production do 
    gem 'pg' 
end 

比:

RAILS_ENV=production bundle exec rake assets:precompile 
git add -A 
git commit -m "blabla" 
git push 
git push heroku 
+0

仍然無法正常工作 – zoro 2013-02-13 16:53:28

+0

我編輯了我的答案,包括一步一步的...我希望它有幫助 – gabrielhilal 2013-02-14 09:45:15

+0

Heroku日誌顯示此錯誤在=信息方法= GET路徑= /主機= guarded-atoll-1158.herokuapp.com fwd = 117.204.119.60 dyno = web.1隊列= 0等待= 0ms連接= 7ms服務= 1583ms狀態= 500字節= 643 – zoro 2013-02-15 04:55:20

相關問題