【问题标题】:How do I prevent my "production" group from being called when running in my Rails development enviornment?在我的 Rails 开发环境中运行时,如何防止调用我的“生产”组?
【发布时间】:2017-03-04 20:02:35
【问题描述】:

我在 Mac OS X (El Capitan) 上使用 Rails 4.2.7。我在 Gemfile 的末尾有这个(用于我的生产环境)。我的 Gmefile 中没有其他对 puma 的引用……

group :production do
  gem 'pg'
  gem 'unicorn'
  gem 'puma'
end

但是当我尝试在我的开发机器(我的 Mac)上启动我的 Rails 服务器时,它正在尝试启动 Puma ......

localhost:networkingproject localuser$ rails s -b 127.0.0.1
=> Booting Puma
=> Rails 4.2.7.1 application starting in development on http://127.0.0.1:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[93431] Puma starting in cluster mode...
[93431] * Version 3.6.0 (ruby 2.3.0-p0), codename: Sleepy Sunday Serenity
[93431] * Min threads: 1, max threads: 6
[93431] * Environment: development
[93431] * Process workers: 1
[93431] * Phased restart available
[93431] * Listening on tcp://127.0.0.1:3000
[93431] Use Ctrl-C to stop
localhost:networkingproject localuser$

我没有设置 RAILS_ENV。下面的内容没有任何回应……

localhost:networkingproject localuser$ echo $RAILS_ENV

如何让 Rails 在我的开发 (Mac) 环境中不使用 Puma(正常)运行?

编辑:输出以响应给出的建议……

localhost:networkingproject localuser$ rails s -b 127.0.0.1
Could not find gem 'puma' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.

【问题讨论】:

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


    【解决方案1】:

    好吧,您确定您没有安装 puma gem(不是从您的 Gemfile 安装的)吗?试试

    gem list

    检查它并

    gem uninstall puma

    如果你有它并想删除它以确保

    不管怎样,通常bundle install --without production 会成功

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-21
      • 1970-01-01
      • 2011-07-28
      • 1970-01-01
      • 2010-11-23
      • 2016-10-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多