2012-01-16 109 views
0

我嘗試我的Rails應用程序推送到Heroku的,但遇到了以下錯誤
的Rails的Heroku應用程序錯誤

Application Error 

An error occurred in the application and your page could not be served. Please try again in a few moments. 

If you are the application owner, check your logs for details. 

因爲我使用的sqlite3
在web顯示一個搜索我應該做到以下幾點

heroku rake db:create 
heroku rake db:migrate 

Heroku的耙分貝:創建抱怨

失敗

命令gem install activerecord-postgresql-adapter失敗,抱怨

ERROR: Could not find a valid gem 'activerecord-postgresql-adapter' (>= 0) in any repository 
ERROR: Possible alternatives: activerecord-postgis-adapter, activerecord-jdbcpostgresql-adapter, activerecord-postgresql-cursors, activerecord-jdbcmysql-adapter, activerecord-jdbcmssql-adapter 

然後我又在網上搜索,並遵循http://devcenter.heroku.com/articles/how-do-i-use-sqlite3-for-development建議改變

gem 'sqlite3' 

group :production do 
    gem 'pg' 
end 
group :development, :test do 
    gem 'sqlite3' 
end 

和運行

bundle install --without production 

然而這並沒有解決另一個來源說,我需要做的像

group :production do 
    gem 'therubyracer-heroku', '0.8.1.pre3' 
    gem "pg" 
end 

這也沒能解決問題

我有我的系統上安裝postresql問題 。 那到底是什麼問題?

+0

沒有這個不斷得到解決? – Laser 2012-05-22 16:53:04

回答

2

這裏的關鍵是,pg寶石需要對你最終使用Postgres數據庫運行時部署到Heroku的(http://devcenter.heroku.com/articles/database)

理想情況下,您希望在本地運行Postgres,以便從數據庫的角度看,開發和生產之間沒有任何差異。

如果你想堅持的事情,你如何擁有他們只需將gem "pg"添加到您的Gemfile應該解決這個問題。

添加完畢後,運行:

bundle install 
git add . 
git commit -am "Added PG to Gemfile" 
git push heroku master 
heroku rake db:migrate 
+0

我完全聽從你的指示。網頁現在從應用程序錯誤更改爲我們很抱歉,但出錯了。 我們已收到有關此問題的通知,我們會盡快查看。 ------這是什麼意思?這是我的問題或heroku的問題? – user1143669 2012-01-16 19:34:01

+0

你的日誌裏有什麼? 'heroku日誌' – 2012-01-16 21:55:36

0
請對Heroku的服務器上部署以下步驟

首先請從Gemfile中取出寶石= 'sqlite3的',添加寶石= 'PG'

運行此命令在項目路徑:捆綁安裝

git add。

git的承諾-am 「創業板文件中添加PG」

混帳推Heroku的主

相關問題