Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Adding rspec-rails in config.gem forces the use of test database

#1834
  • Rails version : 2.2.2
  • Environment : production mode only, apache 2.2, mod_rails / mongrel (./script/server)
  • Applications : any (Typo, Redmine, personnal Rails app)

Adding a call to rspec-rails in your gems dependencies in environment.rb forces the use of test database, regardless the RAILS_ENV I can set, exporting env vars or forcing it in environment.rb


config.gem 'rspec-rails', :lib => 'spec/rails', :version => '>= 1.1.11'

Commenting the line just brings things back to normal

Reported by Frédéric de Villamil · February 1st, 2009 @ 08:26 AM

State: invalid
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Matt Jones
    Matt Jones

    The problem is that rspec-rails overwrites the environment. Note the warning in rspec-rails's init.rb not to add any includes.

    You'll probably want to add :lib => false to your config.gem line to keep rspec from being loaded all the time.

    I don't think that the rspec generator is going be usable unless you've got the gem installed locally (see #1757 Generators don't load gems from environment.rb).

    February 18th, 2009 @ 01:32 AM

  2. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from new to invalid

    April 22nd, 2009 @ 10:17 PM