Rails:我安装了 Ruby,现在“捆绑安装”不起作用

Dav*_*ave 2 ruby installation bundle ruby-on-rails-4

我正在使用 Rails 4.2.7。我下载了一个示例,它显然要求我使用 Ruby 2.1.6 而不是我安装的 Ruby 2.3.0 版本……

localhost:lti_tool_provider_example-master davea$ bundle install
Your Ruby version is 2.3.0, but your Gemfile specified 2.1.6
Run Code Online (Sandbox Code Playgroud)

所以这就是我所做的。但是在安装 Ruby 2.1.6 之后,现在“捆绑安装”不起作用……

localhost:lti_tool_provider_example-master davea$ rvm install ruby-2.1.6
Warning! PATH is not properly set up, '/Users/davea/.rvm/gems/ruby-2.3.0/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-2.3.0'.
Warning, new version of rvm available '1.27.0', you are using older version '1.26.11'.
You can disable this warning with:    echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable  auto-update  with:    echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
Found remote file https://rubies.travis-ci.org/osx/10.12/x86_64/ruby-2.1.6.tar.bz2
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
ruby-2.1.6 - #configure
ruby-2.1.6 - #download
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 7630k  100 7630k    0     0  1199k      0  0:00:06  0:00:06 --:--:-- 1551k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.1.6 - #validate archive
ruby-2.1.6 - #extract
ruby-2.1.6 - #validate binary
Libraries missing for ruby-2.1.6: cannot. Refer to your system manual for installing libraries
Mounting remote ruby failed with status 10, trying to compile.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: DYLD_LIBRARY_PATH environment variable is set, this might interact with the compilation and ruby.
Installing Ruby from source to: /Users/davea/.rvm/rubies/ruby-2.1.6, this may take a while depending on your cpu(s)...
ruby-2.1.6 - #downloading ruby-2.1.6, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11.4M  100 11.4M    0     0  2272k      0  0:00:05  0:00:05 --:--:-- 2354k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.1.6 - #extracting ruby-2.1.6 to /Users/davea/.rvm/src/ruby-2.1.6....
ruby-2.1.6 - #configuring....................................................
ruby-2.1.6 - #post-configuration.
ruby-2.1.6 -    #compiling.......................................................................................................................................
ruby-2.1.6 - #installing...............
ruby-2.1.6 - #making binaries executable..
ruby-2.1.6 - #downloading rubygems-2.4.8
ruby-2.1.6 - #extracting rubygems-2.4.8.....
ruby-2.1.6 - #removing old rubygems.........
ruby-2.1.6 - #installing rubygems-2.4.8......................
ruby-2.1.6 - #gemset created /Users/davea/.rvm/gems/ruby-2.1.6@global
ruby-2.1.6 - #importing gemset /Users/davea/.rvm/gemsets/global.gems...............................................
ruby-2.1.6 - #generating global wrappers........
ruby-2.1.6 - #gemset created /Users/davea/.rvm/gems/ruby-2.1.6
ruby-2.1.6 - #importing gemsetfile /Users/davea/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.1.6 - #generating default wrappers........
ruby-2.1.6 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.1.6 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri
localhost:lti_tool_provider_example-master davea$ bundle install
-bash: bundle: command not found
Run Code Online (Sandbox Code Playgroud)

如何在不干扰我刚安装的 Ruby 2.1.3 版本的情况下恢复“bundle”命令?

Eri*_*nil 5

与 Ruby 2.1.6 捆绑

你只需要安装bundler

rvm use ruby-2.1.6
gem install bundler
Run Code Online (Sandbox Code Playgroud)

这将安装在特定于 ruby​​-2.1.6 的 gemset 中,因此它不会干扰您使用 ruby​​-2.3.0 安装的任何内容。您可以使用

bundle install
Run Code Online (Sandbox Code Playgroud)

安装所需的宝石。

尝试使用 Ruby 2.3.0

或者,您可以尝试通过更改 ruby​​-2.3.0 下载的示例

ruby '2.1.6'
Run Code Online (Sandbox Code Playgroud)

行或从Gemfile.