Skip to content

Book p19: rake db:migrate RAILS_ENV=test #1

@ghost

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions