[rspec-users] RSpec-rails 1.2.2: autospec passes but "rake spec" fails

Tadatoshi Takahashi lists at ruby-forum.com
Wed Mar 25 17:49:39 EDT 2009

Stephen Eley wrote:
> On Wed, Mar 25, 2009 at 3:29 PM, Tadatoshi Takahashi
> <lists at ruby-forum.com> wrote:
>> P.S.
>> It seems that autospec is run against test database and that "rake spec"
>> is run against development database.
>> How can I resolve this problem?
> The first thing I'd check would be whether you have RAILS_ENV defined
> in your .profile or .bashrc or wherever.  RSpec used to always declare
> the 'test' environment, but the latest version of spec_helper.rb
> declares it conditionally:
> ENV["RAILS_ENV"] ||= 'test'
> It shouldn't be necessary to declare your environment as 'development'
> in the shell, because it's usually the default.  So if you have that
> environment variable set somewhere, take it out.
> --
> Have Fun,
>    Steve Eley (sfeley at gmail.com)
>    ESCAPE POD - The Science Fiction Podcast Magazine
>    http://www.escapepod.org

Hi, Steve,

Thank you for your reply.

I have never set RAILS_ENV anywhere.
To make sure, I have looked at .profile but RAILS_ENV is not set there.

Is there any other place where that RAILS_ENV is getting set?

Thank you.


Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list