service-oriented-design-with-ruby
service-oriented-design-with-ruby copied to clipboard
Book p19: rake db:migrate RAILS_ENV=test
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 you saved my day!
thq man :- )