2013-03-12 72 views
4

我需要在我的gemfile中指定ruby版本,但我在heroku中的应用程序使用的是旧版本1.0.7。如何在heroku中设置捆绑器版本?

如果我在我的gemfile中包含gem 'bundler', '1.3.2',那么当我推送到heroku时,它会失败。

Bundler could not find compatible versions for gem "bundler": 
    In Gemfile: 
    bundler (= 1.3.2) 

    Current Bundler version: 
    bundler (1.0.7) 

Your version of Bundler is older than the one requested by the Gemfile. 
Perhaps you need to update Bundler by running `gem install bundler`. 

我也尝试运行heroku run "gem install bundler"并且它返回权限错误。

ERROR: While executing gem ... (Gem::FilePermissionError) 
    You don't have write permissions into the /usr/ruby1.9.2/lib/ruby/gems/1.9.1 
directory. 

如何在Heroku中将Bundler版本设置为1.3.2以便我可以指定具体的ruby版本?

+1

你在Cedar堆栈上吗? – 2013-03-12 09:54:47

回答

5

Heroku管理捆绑器作为堆栈的一部分。我猜你在使用1.0.7的Bamboo堆栈,而Cedar使用的是1.3.x版本。

如果你是竹子,那么除了升级到雪松之外,你恐怕没有任何选择,你会得到所有最新的善良。

+0

谢谢John Beynon。是的,我在竹栈。我如何迁移到Cedar堆栈? – stanicmail 2013-03-13 00:20:47

+1

Heroku有一个完整的文章https://devcenter.heroku.com/articles/cedar-migration – 2013-03-13 08:40:18

+0

谢谢。我已经迁移到Cedar堆栈,现在我的捆绑器1.3.2。 – stanicmail 2013-03-14 00:38:24