如何在我的Rails开发环境中运行时阻止调用“生产”组?

时间:2016-10-22 17:04:58

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

我在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

如何在我的开发(Mac)环境中使Rails在没有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.

1 个答案:

答案 0 :(得分:0)

嗯,你确定你没有安装puma gem(不是你的Gemfile)吗?尝试

gem list

检查并

gem uninstall puma

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

无论如何,通常bundle install --without production可以做到这一点