2012-04-03 197 views
4

我學習的回報率,並試圖我的測試應用程序部署到Heroku的接收下一個錯誤:部署Rails應用程序在Heroku

Unresolved dependencies detected; Installing... 
    Using --without developmen 
    You have modified your Gemfile in development but did not check 
    the resulting snapshot (Gemfile.lock) into version control 

    You have added to the Gemfile: 
    * therubyracer (~> 0.9.3.beta1) 
    * pg 
    FAILED: http://devcenter.heroku.com/articles/bundler 

! Heroku推拒絕,未能通過Bundler安裝寶石

請!幫幫我!

回答

7

你提交了你的Gemfile.lock?

bundle install 
git add Gemfile.lock 
git commit -am "Add lock file" 
git push heroku master 
+1

並在此之前,你運行'捆綁安裝'? – Chowlett 2012-04-03 11:30:23

2

此錯誤可能是因爲您沒有完全執行捆綁安裝。

首先做

bundle install 

添加gem 'pg'創業板文件並安裝Postgres的寶石和Postgres在本地機器上。如果您不想在本地計算機上安裝postgres,請將gem'pg添加到生產環境並運行不帶測試環境的捆綁軟件安裝。雖然heroku不鼓勵這種運行你的應用程序的方式。使用相同的數據庫來運行本地和生產總是更好。安裝postgres很痛苦,但它是值得的。

Your ruby should be 1.9.2. 

您的計算機上安裝所有的依賴和後GRES後做bundle install和你的寶石文件添加到Heroku的。

git add Gemfile 
git add Gemfile.lock 
git commit 
git push heroku master