rub*_*man 5 ruby ruby-on-rails bundler
我的系统中安装了 Ruby 2.3.0。的输出ruby -v是:
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
Run Code Online (Sandbox Code Playgroud)
当我尝试使用以下方法运行 Rails 时:
bundle exec rails new ~/my-test-app --dev
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Your Ruby version is 2.1.7, but your Gemfile specified 2.3.0
Run Code Online (Sandbox Code Playgroud)
我安装了两个 Ruby 版本。如何让 bundle 使用 Ruby 2.3.0 而不是 2.1.7
TL;DR 将 /usr/local/bin/bundle 中的 Ruby 版本从 2.1 更改为 2.3。
解释
要找出正在使用哪个 Ruby 捆绑程序,请输入
which bundle
Run Code Online (Sandbox Code Playgroud)
这应该打印
/usr/local/bin/捆绑包
现在打开文件并将 Ruby 版本从 2.1 更改为 2.3
| 归档时间: |
|
| 查看次数: |
1474 次 |
| 最近记录: |