Topic: Rake and Rails.env in rails 3.0.6
Hey Guys,
An easy question.... How do I set Rails.env so that when I invoke
> rake db:schema:load
The db schema in my test database gets loaded?
Last edited by sonnychee (2011-04-18 02:21:18)
You are not logged in. Please login or register.
Hey Guys,
An easy question.... How do I set Rails.env so that when I invoke
> rake db:schema:load
The db schema in my test database gets loaded?
Last edited by sonnychee (2011-04-18 02:21:18)
You want to make sure your test db is properly migrated up (that is, up to date with the dev database), right?
To do that you run
rake db:test:cloneChris
Thanks Chris, that works. Would you also have any insight into...
> How do I set Rails.env ?
Well, typically you wouldn't want to specify that in the code anywhere (except when testing -- then it gets set in a spec helper, at least if you are using RSpec; not sure with TestUnit). If you need (for example) to run your application in production mode, you can do so by doing
rails server -e productionIf you really want to know how to set Rails.env in code, you can look at how a spec_helper does that.
Chris
Hosting provided by aTech Media