使用橡胶降级 rails gem
Downgrade rails gem with Rubber
我有一个 rails gem,由于新版本存在问题,我需要降级到旧版本:aws-sdk
我更新了我的本地 Gemfile 并推送到我的 git 服务器到:
gem 'aws-sdk', '< 2.0'
现在,我需要用降级的 gem 更新我的生产服务器,而不是它当前拥有的较新版本。
我试过 cap deploy
,但出现此错误:
** [out :: app01-myserver.com] You are trying to install in deployment mode after changing
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] your Gemfile. Run `bundle install` elsewhere and add the
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] updated Gemfile.lock to version control.
** [out :: app01-myserver.com]
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] You have added to the Gemfile:
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] * aws-sdk (< 2.0)
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] You have deleted from the Gemfile:
** [out :: app01-myserver.com] * aws-sdk
那么,是否有 cap
或 rubber
命令可以让我从命令行 运行 更新 Gemfile?
如错误消息中所述,您应该将 Gemfile.lock
添加到 git。在 运行 bundle update aws-sdk
之后,提交 Gemfile.lock
中的更改,将其推送并使用 cap
.
部署到生产服务器
我有一个 rails gem,由于新版本存在问题,我需要降级到旧版本:aws-sdk
我更新了我的本地 Gemfile 并推送到我的 git 服务器到:
gem 'aws-sdk', '< 2.0'
现在,我需要用降级的 gem 更新我的生产服务器,而不是它当前拥有的较新版本。
我试过 cap deploy
,但出现此错误:
** [out :: app01-myserver.com] You are trying to install in deployment mode after changing
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] your Gemfile. Run `bundle install` elsewhere and add the
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] updated Gemfile.lock to version control.
** [out :: app01-myserver.com]
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] You have added to the Gemfile:
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] * aws-sdk (< 2.0)
** [out :: app01-myserver.com]
** [out :: app01-myserver.com] You have deleted from the Gemfile:
** [out :: app01-myserver.com] * aws-sdk
那么,是否有 cap
或 rubber
命令可以让我从命令行 运行 更新 Gemfile?
如错误消息中所述,您应该将 Gemfile.lock
添加到 git。在 运行 bundle update aws-sdk
之后,提交 Gemfile.lock
中的更改,将其推送并使用 cap
.