Ubuntu 11.
我做以下事情:
$ rvm --default use 1.9.2
我得到:
Using /home/md/.rvm/gems/ruby-1.9.2-p180
这样很好.
但是当我现在打开一个新的终端窗口时,我仍然得到:
$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
我是一个Rails newb谁正在尝试使用DigitalOcean Droplet上的Rails.安装似乎工作正常,但当我尝试生成脚手架时,我收到一条奇怪的错误消息:
DO 10:48 Rails/simple (master) ? rails generate scaffold User name:string email:string
Traceback (most recent call last):
5: from bin/rails:3:in `<main>'
4: from bin/rails:3:in `load'
3: from /home/tony/rails/simple/bin/spring:10:in `<top (required)>'
2: from /home/tony/rails/simple/bin/spring:10:in `new'
1: from /home/tony/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:95:in `initialize'
/home/tony/.rvm/rubies/ruby-2.6.0/lib/ruby/2.6.0/bundler/lockfile_parser.rb:108:in `warn_for_outdated_bundler_version': You must use Bundler 2 or greater with this lockfile. (Bundler::LockfileError)
DO 10:49 Rails/simple (master) ? bundle list bundler
/home/tony/.rvm/gems/ruby-2.6.0/gems/bundler-2.0.1
DO 10:50 Rails/simple (master) ? gem list bundler
*** LOCAL GEMS ***
bundler (2.0.1, default: 1.17.2)
bundler-unload (1.0.2) …Run Code Online (Sandbox Code Playgroud) 我正在尝试2.1在从ruby:2.4.1. 我的 Docker 文件如下所示:
FROM ruby:2.4.1
RUN \
gem update --system --quiet && \
gem install bundler -v '~> 2.1'
# Other commands
Run Code Online (Sandbox Code Playgroud)
但是当我尝试运行时bundle install它失败了
You must use Bundler 2 or greater with this lockfile.
Run Code Online (Sandbox Code Playgroud)
当我在容器内运行时,gem info bundler它输出:
bundler (2.1.2, 1.15.4)
Authors: André Arko, Samuel Giddins, Colby Swandale, Hiroshi
Shibata, David Rodríguez, Grey Baker, Stephanie Morillo, Chris
Morris, James Wen, Tim Moore, André Medeiros, Jessica Lynn Suttles,
Terence Lee, Carl Lerche, Yehuda …Run Code Online (Sandbox Code Playgroud)