2013-03-12 70 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