Gemfile包含不正确的环境

时间:2014-03-21 07:09:09

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

当我做$ bundle install时,尽管我正在开发中,但它试图获得仅用于制作的宝石。

我仔细检查了我的发展情况:echo $RAILS_ENV # outputs "development"

这是我的gem文件的副本。如果我删除了最后一个块中的:staging,那么我的bundle会正确安装并忽略该组。为什么添加:staging会导致我的应用包含这些宝石?

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

1 个答案:

答案 0 :(得分:0)

使用bundle install --without staging production。您可以找到有关捆绑here的更多信息。

更新

由于Bundler.require(:default, Rails.env)中存在config/application.rb,因此默认情况下捆绑包不会安装测试和生产中存在的宝石。