簡體   English   中英

部署到Heroku時Ruby版本出現問題

[英]Ruby version trouble when deploying to Heroku

我正在使用以下版本的Ruby:ruby-1.9.3-p36。 雖然我在運行rvm時遇到此錯誤。

$ rvm list
Warning! PATH is not properly set up, '/Users/user/.rvm/gems/ruby-1.9.3-p362/bin' is not at first place,
     usually this is caused by shell initialization files - check them for 'PATH=...' entries,
     it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
     to fix temporarily in this shell session run: 'rvm use ruby-1.9.3-p362'.

rvm rubies

    ruby-1.9.3-p327 [ x86_64 ]
 =* ruby-1.9.3-p362 [ x86_64 ]
    ruby-2.0.0-rc1 [ x86_64 ]

我剛部署到Heroku並收到應用程序錯誤:

ruby-1.9.3-p550 is not installed.
To install do: 'rvm install ruby-1.9.3-p550'

為什么Heroku嘗試使用“ p550”?

Ruby 在支持頁面上列出了一組可用的紅寶石版本和補丁級別。

其中包括MRI ruby-1.9.3-p550但不包括p362

第一步應該是在本地安裝p550

$ rvm install ruby-1.9.3-p550

你可以捆綁通過向警告PATCHLEVEL missmatches patchlevel您的Gemfile紅寶石的要求。

ruby '1.9.3', :patchlevel => '550'

您可以通過添加.ruby-version文件,使RVM在切換到項目目錄時自動切換到正確的ruby版本:

$ echo ruby-1.9.3-p550 > .ruby-version 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM