2013-06-25 47 views
3

試圖做一個bundle install的紅寶石(西納特拉)的項目,我不斷收到此錯誤:寶石:: InstallError:引入nokogiri需要Ruby版本> = 1.9.2

Gem::InstallError: nokogiri requires Ruby version >= 1.9.2. 
An error occurred while installing nokogiri (1.6.0), and Bundler cannot continue. 
Make sure that `gem install nokogiri -v '1.6.0'` succeeds before bundling. 

於是我繼續前進,gem install nokogiri -v '1.6.0'和以成功結束。

然後我再次嘗試bundle install並得到錯誤。沖洗並重復。

我不是一個紅寶石dev,所以我不知道該怎麼做。任何幫助?

+1

運行'紅寶石-v',你怎麼回來的? –

+0

ruby​​ 1.9.3p429(2013-05-15 revision 40747)[x86_64-darwin12.3.0] – wesbos

+0

你有.rvmrc文件嗎?同時刪除.bundle目錄 –

回答

2

你試過Bundle update

此外,強烈建議您使用Ruby的版本控制 - rvm是一個很好的解決方案。 https://rvm.io/

然後,你可以做rvm use [email protected] --create,然後溝您使用它,或者使用.rvmrc,堅持這條線在那裏所以它會自動使用乾淨的版本,這取決於你創建的每個應用程序不同的寶石--create每次。

+0

運行軟件包更新給我完全相同的錯誤 – wesbos

+0

您是否嘗試使用rvm?它會給你一個乾淨的寶石,我覺得90%肯定會解決你的問題和未來的問題。 – kaichanvong

+3

rvm使用1.9.3 - 默認解決了問題! – wesbos

0

您可以爲您在您的Gemfile紅寶石版本聲明,也許它鎖定在1.8

相關問題