【问题标题】:rails ignores Gemfilerails 忽略 Gemfile
【发布时间】:2015-05-07 05:58:12
【问题描述】:

我的 Gemfile 看起来像这样:

source 'https://rubygems.org'
ruby '2.2.2'
gem 'rails', '~> 4.2.1'

# a bunch of stuff that is commented out goes here

group :production do

  # Use Postgres as the database for Active Record
  gem 'pg', '~> 0.18.1'

  # An irrelevant comment
  gem 'rails_12factor', '~> 0.0.3'

  # Use Puma as the server
  gem 'puma', '~> 2.11.2'
end

当我通过输入rails server -e development 运行rails 时,我看到它正在运行Puma,即使我的开发环境没有指定Puma。如果注释掉 gem 'puma', '~> 2.11.2' 的行,则使用 WEBrick(如预期的那样)。

为什么在开发环境中使用 Puma,即使它没有在 gemfile 中指定?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 webrick puma railsapps


    【解决方案1】:

    问了这个问题十分钟后,我发现this answer 表明使用bundle install --without production 可以解决问题,而且确实如此。我将把这个问题留在这里,以防其他人有类似的问题。

    【讨论】:

      猜你喜欢
      • 2023-04-10
      • 1970-01-01
      • 2011-11-08
      • 2012-02-26
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      • 2016-07-25
      • 2023-03-04
      相关资源
      最近更新 更多