我嘗試切換到2.3.3版本的命令rvm use 2.3.3
和ruby -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:in
find_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的目錄,這大概是卸載的。希望這可以幫助。
在此先感謝。
顯示您的寶石文件和運行終端 –
@AniketShivamTiwari RVM列表上此RVM列表顯示這:'RVM紅寶石 JRuby的9.1.7.0 [x86_64的] =>紅寶石2.3.3 [x86_64的] ' – boltzmanncte
你的gemfile是否有'ruby「2.3.3」',如果是的話,創建一個名爲'.ruby-version'的文件,並把這個'ruby-2.3.3'放在第一行並保存。重啓終端並運行'bundle'。 –