0

I am trying to switch my Rails TEST environment from SQLite3 to Postgresql.

However, when I run

rake spec:requests

this error is generated:

omar@loco:~/apps/gctest$ rake spec:requests
rake aborted!
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

Tasks: TOP => db:test:load => db:test:purge
(See full trace by running task with --trace)

I am able to access the DB in Development (my database.yml file for test looks similar to development but with _test).

Are there any gotchas that I'm unaware of? what does the "Tasks:..." line mean?

My env:

rspec (2.6.0)
rails (3.0.9)
ruby 1.9.2p290
pg (0.11.0)
psql (PostgreSQL) 8.4.8

1 Answer 1

1

I have a suspicion that you do not have the test key in your database.yml file and Rails is attempting to use that and not finding it. However, I could be wrong. That does look like that kind of issue though.

What does --trace at the end of that command make it output extra? Perhaps you could update the question with that output to help us?

Sign up to request clarification or add additional context in comments.

1 Comment

You nailed it, I just realized that right after I posted then came back to delete this post.. I had copied "Development:" twice! ...thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.