【问题标题】:Why is spring being installed on my production server?为什么我的生产服务器上安装了 spring?
【发布时间】:2015-09-21 13:36:17
【问题描述】:

我有一个在:development 中定义了 spring 的 Gemfile,如下所示:

source 'https://rubygems.org'

# Rake and rails
gem 'rake', '~> 10.4.2'
gem 'rails', '4.1.13'

group :production do
  gem 'unicorn', '~> 4.8.3'
end

group :development, :staging do
  gem 'spring'
end

但是,每当我部署时,它都会安装在服务器上。 capistrano 发出的命令如下所示:cd /home/app_user/apps/ag/releases/20150921131835 && bundle install --gemfile /home/app_user/apps/ag/releases/20150921131835/Gemfile --path /home/app_user/apps/ag/shared/bundle --deployment --without development test

我不明白为什么?如何摆脱春天?

我的捆绑器版本是 1.10.6

【问题讨论】:

  • 你没有在without标志中指定staging组,因此它也被安装了
  • 请告诉我,您的config/deploy/production.rb 文件是什么样的?你的config/deploy.rb 文件也是如此。Capistrano 通常使用 Rails 开箱即用地进行良好的生产部署,不知道为什么你的已经失败了。

标签: ruby-on-rails capistrano bundler rbenv


【解决方案1】:

正如 Yury Lebedev 在评论中提到的那样,您没有排除 without 标志中的 staging 组,因此还安装了定义为 staging 的 gem(包括您的情况下的 spree)。

【讨论】:

    猜你喜欢
    • 2019-04-28
    • 1970-01-01
    • 1970-01-01
    • 2013-09-22
    • 2014-12-28
    • 2015-09-03
    • 2018-10-13
    • 2016-02-07
    • 1970-01-01
    相关资源
    最近更新 更多