Natalia Natalia - 1 month ago 10
Ruby Question

How do I prevent my "production" group from being called when running in my Rails development enviornment?

Im using Rails 4.2.7 on Mac OS X (El Capitan). I have this at the end of my Gemfile (for my production environment). I have no other references to puma in my Gmefile …

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


but when I attempt to start my Rails server on my development machine (my Mac), it is attempting to start up 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$


I don’t have a RAILS_ENV set. The below echoes nothing …

localhost:networkingproject localuser$ echo $RAILS_ENV


How do I make Rails run without Puma (just normally) in my development (Mac) environment?

Edit: Output in response to suggestion given …

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.

Answer

Well, are you sure you don't have puma gem installed (not from your Gemfile)? Try

gem list

to check it and

gem uninstall puma

if you have it and want to remove it to be sure

Anyway, usually bundle install --without production do the trick

Comments