Reputation: 63567
How can I set my Rails environment to development?
According to this question: How do I set my rails 3 app to development mode?, you add ENV['RAILS_ENV'] = 'development'
to config/environment.rb.
I did this, but when I try to bundle install, it still tries to install gems for 'production'. I've placed the environment variable line at the start, middle, and end of file.
# Load the Rails application.
require File.expand_path('../application', __FILE__)
# Initialize the Rails application.
Grafly::Application.initialize!
ENV['RAILS_ENV'] = 'development'
Upvotes: 1
Views: 3749
Reputation: 4288
This is normal. Bundler is a general-purpose dependency manager for Ruby. It has no idea that Rails exists. The group
directives are exposing Bundler's groups feature, not a function of Rails.
If you don't instruct Bundler otherwise, it will install every gem from every group. It doesn't know what groups you do and don't want installed; it just knows that you defined some groups.
If you don't want to install all of your gems (or can't install all of your gems), you can skip production:
bundle install --without production
Similarly, you can skip development and testing gems when you deploy:
bundle install --without development test
(This is how, for example, Heroku and Cloud66 install only the gems you need for production.)
Upvotes: 4