Question

When I do $ bundle install, it attempts to get gems only meant for production, despite me being on development.

I double checked that I'm on development: echo $RAILS_ENV # outputs "development"

Here is a copy of my gem file. If I remove :staging in the last block, then my bundle installs correctly and ignores this group. Why would adding :staging cause my app to include these gems?

source 'https://rubygems.org'
ruby '2.0.0'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.0'
gem 'bootstrap-sass', '~> 3.0.1.0.rc'
gem 'bcrypt-ruby', '3.0.1'
# generates names, email addresses, and other placeholders for factories.
gem 'faker'
gem 'will_paginate', '3.0.4'
gem 'bootstrap-will_paginate', '0.0.9'
gem 'aws-sdk', '1.11.1'
gem 'd3-rails', '~>3.3.7'
# used for file ajax uploads
gem 'remotipart', '~> 1.2'
# used for making server side variables accessible in JS
gem "iconv", "~> 1.0.4"
gem "roo", "~> 1.13.2"
gem 'underscore-rails'

gem 'gon', '4.1.0'
# gem "introjs-rails"
# High voltage for static pages
gem 'high_voltage', '~> 2.0.0'
gem "koala", "~> 1.8.0rc1"
gem 'acts_as_list'
gem "bugsnag"
gem 'devise'
# EC2 server is passenger
gem 'passenger'
# easily create seeds
gem 'seed_dump'
#add crossfilter for exploring high dimensional datasets and dcjs for charts
gem 'crossfilter-rails'
# gem 'dcjs-rails'
gem 'activeadmin', github: 'gregbell/active_admin'
# Monitor site speed.
gem 'newrelic_rpm'

group :development, :test do
  gem 'sqlite3', '1.3.8'
  # rspec-rails includes RSpec itself in a wrapper to make it play nicely with Rails.
  gem 'rspec-rails'
  # replaces Rails' default fixtures for feeding test data to the test suite with much more preferable factories
  gem 'factory_girl_rails'
  # watches your application and tests and runs specs for you automatically when it detects changes.
  gem 'guard-rspec'
end

group :test do
  # runs a browser
    gem 'selenium-webdriver'
  # makes it easy to programatically simulate your users' interactions with your application
    gem 'capybara'
  # Shows growl notifications (os x only)
  gem 'growl'
  # opens your default web browser upon failed integration specs to show you what your application is rendering.
  gem 'launchy' # tims tutorial
  # helps clear out db after using selenium in tests
  gem 'database_cleaner' # tims tutorial
end

gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
# fuck turbolinks.
# gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
# added for resizing panes on d3fiddle pages
gem 'jquery-ui-rails'
# added for code highlighting on d3fiddle pages
gem 'codemirror-rails'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end

group :production, :staging do
    gem 'pg', '0.15.1'
    gem 'rails_12factor', '0.0.2'
end
Was it helpful?

Solution

Use bundle install --without staging production.You can find more information about bundle here.

Update:

It is because of Bundler.require(:default, Rails.env) present in config/application.rb that bundle does not install gems present in test and production by default.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top