2012-04-03 165 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