ruby-on-rails - 尝试在生产中运行rails控制台时如何修复“spring不是捆绑包的一部分”
问题描述
我希望能够rails console
在安装了 Capistrano(3) 的应用程序上运行。
所以,我添加gem 'capistrano-rails-console', require: false
到 gemfile
以下到 deploy.rb
server 'ip', port: 2, user: 'user', roles: [:web, :app, :db], primary: true
以及 Capfile 的以下内容require 'capistrano/rails/console'
问题是cap production rails:console
导致以下错误
00:00 rails:console
01 $HOME/.rbenv/bin/rbenv exec bundle exec rails console -e production
Traceback (most recent call last):
3: from bin/rails:7:in `<main>'
2: from bin/rails:7:in `load'
1: from /_some_path_/releases/20210808154555/bin/spring:14:in `<top (required)>'
/home/_user_/.rbenv/versions/2.7.2/lib/ruby/2.7.0/bundler/rubygems_integration.rb:346:in `block (2 levels) in replace_gem': spring is not part of the bundle. Add it to your Gemfile. (Gem::LoadError)
我怎样才能解决这个问题?
解决方案
您可能需要将 Spring 添加到 Gemfile。
你能展示你的 Gemfile 吗?
如果你有类似的东西
group :development do
gem 'spring'
您可以将其提升到块上方。
推荐阅读
- javascript - 有没有办法在 react-bootstrap-table-2 中使单元格默认单击或使编辑模式无需单击?
- javascript - 使用 vanilla JS 显示输入类型 = 没有年份的日期
- php - 将 PHP 字符串转换为自定义格式的函数数组
- c# - 如何从 LiveCharts 轴获取轴大小(以像素为单位)以确定轴上的自定义分隔符步数?
- c++ - 将 CoreWindow 作为函数参数传递时出错
- android - 我的函数是异步的,为什么会出现 NetworkOnMainThread 异常?
- mysql - MySQL分组前如何更改顺序?
- output - 输出('',S);使用 Mpdf 和 PHPmailer 破解代码
- twincat - 连接变量
- informatica-powercenter - 安装 Informatica PowerCentre 10.4 PostgreSQL