ruby-on-rails - 如何降级 gemfile 中的 gem?

标签 ruby-on-rails ruby rubygems bundler

我的 Gemfile.lock 中有这个

 sequel (5.15.0)

我想将 gem 版本降级到 4.39.0,所以我进入我的 Gemfile 并在 gem 声明旁边添加一个版本:

gem 'sequel', '4.39.0'

然后运行 ​​bundle exec bundle install

但它给了我:

You have requested:
  sequel = 4.39.0

The bundle currently has sequel locked at 5.15.0.
Try running `bundle update sequel`

If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
Run `bundle install` to install missing gems

. 所以我尝试运行 bundle exec bundle update sequel 但它返回相同的消息。 如何降级 gem ?

最佳答案

你只需要打电话

bundle update sequel

前面没有 bundle exec

您遇到的问题是由 bundle exec 评估您当前的 Gemfile 以首先执行后一个命令引起的。在这里,它会发现 Gemfile 中指定的 gem 与您当前的 Gemfile.lock 之间的差异并退出。

一般来说,所有的 bundle 调用都不需要以 bundle exec 为前缀。

关于ruby-on-rails - 如何降级 gemfile 中的 gem?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53637109/

相关文章:

css - 自定义字体不适用于 Rails

ruby-on-rails - rails 3 : respond_with errors on undefined URL helper

ruby-on-rails - Rails 3/Heroku/Memcached - 未命中/未命中、存储/新鲜

ruby - 如何使用 'like' 进行 Sql 查询?

ruby-on-rails - elasted_job enqueue 方法出现新错误

ruby - 有没有一种简单的方法来模拟 Dir::glob?

jquery - Ruby on Rails 网站 : Adding/Removing Active Class to Navbar

ruby - 删除并重新安装 ruby​​gems(重新安装 RVM)

ruby-on-rails - 找不到您的/home/rails/webapp/Gemfile.lock 所需的 'bundler' (2.1.4)。 (Gem::GemNotFoundException) 运行 docker build

ruby - 需要 nokogiri : Load Error