无法安装捆绑ruby版本管理器

时间:2018-06-08 05:50:05

标签: bash rvm

我之前从未尝试过Ruby。我正在尝试运行此elixirschool github repo

我首先收到此错误消息。

$ bundle install  
Your Ruby version is 2.5.1, but your Gemfile specified ~> 2.3.7

所以我按照问题的说明进行操作。 How to fix "Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0"

现在我收到此消息。

$ bundle install  
Traceback (most recent call last):  
    1: from /usr/local/bin/bundle:23:in `<main>'
/usr/local/bin/bundle:23:in `load': cannot load such file -- /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/exe/bundle (LoadError)

我也做了这个命令。

$ bundler install
Traceback (most recent call last):
    2: from /usr/local/bin/bundler:23:in `<main>'
    1: from /usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/rubygems.rb:308:in `activate_bin_path'
/usr/local/Cellar/ruby/2.5.1/lib/ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundler (Gem::GemNotFoundException)

2 个答案:

答案 0 :(得分:1)

打开文件夹根目录中的gemfile并将其删除:

BUNDLED WITH
   1.16.2 #or whatever version number you see 

然后运行:

sudo gem install bundler

检查:

bundle --version

答案 1 :(得分:0)