service-oriented-design-with-ruby icon indicating copy to clipboard operation
service-oriented-design-with-ruby copied to clipboard

Book p19: rake db:migrate RAILS_ENV=test

Open ghost opened this issue 13 years ago • 2 comments

Hi Paul,

I'm reading and working through you book page by page, bumping into issues mostly related to the fact that I'm am trying to learn Ruby and SOD at the same time. I have run into this issue on page 19 of the book where it says that to migrate the test database, one needs to run the command:

    rake db:migrate RAILS_ENV=test

Upon repeatedly running this command and searching why it didn't run (to no avail), I turned to the rakefile and there I found that the env variable is set to either SINATRA_ENV or development (line 11?):

   env = ENV["SINATRA_ENV"] || "development"

Then when running the rake command again as below, my migration ran fine:

    rake db:migrate SINATRA_ENV=test

As I said, I am learning as I go, so this may not be the optimal solution. I would love to hear if I went up the right track on this one.

Rgdz, Oscar

ghost avatar Jun 05 '11 13:06 ghost

@ghost you saved my day!

chandresh avatar Sep 29 '12 09:09 chandresh

thq man :- )

thishanth avatar Aug 20 '13 09:08 thishanth