2017-05-09 73 views
2

我嘗試切換到2.3.3版本的命令rvm use 2.3.3ruby -v顯示:卸載紅寶石2.4.1,並不斷收到錯誤:「你的Ruby版本是2.4.1,但你的Gemfile指定2.3.3」

ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

但是當我運行rake db:create:all db:migrate db:seed我不斷收到上面提到的錯誤:

Your Ruby version is 2.4.1, but your Gemfile specified 2.3.3

我也嘗試其他可能的解決方法,但沒有一個似乎工作。

因此,我決定卸載2.4.1和2.4.0版本,但錯誤不斷顯示。

我該怎麼辦?

希望你能幫助和謝謝!

編輯:

命令rvm list所示:

rvm rubies

 jruby-9.1.7.0 [ x86_64 ] 
     ruby-2.3.3 [ x86_64 ] 

當命令bunde -v運行顯示了該:

/usr/local/lib/ruby/2.4.0/rubygems.rb:270:infind_spec_for_exe': can't find gem bundler (>= 0.a) (Gem::GemNotFoundException) from /usr/local/lib/ruby/2.4.0/rubygems.rb:298:in activate_bin_path from /usr/local/bin/bundler:22:in '<main>'

所以我檢查了/usr/local/lib/ruby,並有一個2.4.0的目錄,這大概是卸載的。希望這可以幫助。

在此先感謝。

+0

顯示您的寶石文件和運行終端 –

+0

@AniketShivamTiwari RVM列表上此RVM列表顯示這:'RVM紅寶石 JRuby的9.1.7.0 [x86_64的] =>紅寶石2.3.3 [x86_64的] ' – boltzmanncte

+0

你的gemfile是否有'ruby「2.3.3」',如果是的話,創建一個名爲'.ruby-version'的文件,並把這個'ruby-2.3.3'放在第一行並保存。重啓終端並運行'bundle'。 –

回答

0

can't find gem bundler建議您沒有安裝捆綁軟件,即使您有gemfile?

嘗試運行gem install bundler並且應該解決問題。

相關問題