Forum: Ruby on Rails rake migrate RAILS_ENV="production"

089cc91c7b1dd1d020f0746dac12a85c?d=identicon&s=25 Dave Verwer (daveverwer)
on 2006-07-05 11:06
On the wiki it says to migrate your DB to production, you can run:

  rake migrate RAILS_ENV="production"

This is taken from:

  http://wiki.rubyonrails.com/rails/pages/Understand...

My database is set up with correct MySQL permissions granted and the
database.yml is pointing at it. I get no errors when I run it, but
equally my production database does not change at all. When I run the
comment I just get this:

  dave$ rake migrate RAILS_ENV="production"
        (in /Users/dave/Sites/sampleapp)
  dave$

What am I doing wrong?
631d1677786f0725da6ccee46043686e?d=identicon&s=25 Jonathan Viney (Guest)
on 2006-07-05 11:12
(Received via mailing list)
Try it the other way round:

RAILS_ENV=production rake migrate

-Jonathan.
089cc91c7b1dd1d020f0746dac12a85c?d=identicon&s=25 Dave Verwer (daveverwer)
on 2006-07-05 11:29
Unfortunately that doesnt work either, same result.

I also found mention of an environment variable called RAILS_ENV so I
also tried the following:

  $ set RAILS_ENV=production
  $ rake migrate

Unfortunately, nothing new happened...



Jonathan Viney wrote:
> Try it the other way round:
>
> RAILS_ENV=production rake migrate
>
> -Jonathan.
631d1677786f0725da6ccee46043686e?d=identicon&s=25 Jonathan Viney (Guest)
on 2006-07-05 11:33
(Received via mailing list)
export RAILS_ENV=production
rake migrate

Are you sure you haven't manually set the value in environment.rb ...

-Jonathan.
089cc91c7b1dd1d020f0746dac12a85c?d=identicon&s=25 Dave Verwer (daveverwer)
on 2006-07-05 11:39
This worked, i'll see if I can update the Wiki because I guess that
should contain the correct instructions :)

Jonathan Viney wrote:
> export RAILS_ENV=production
> rake migrate

Thanks for your help Jonathan
631d1677786f0725da6ccee46043686e?d=identicon&s=25 Jonathan Viney (Guest)
on 2006-07-05 13:51
(Received via mailing list)
Great.

Are you really sure that 'RAILS_ENV=production rake migrate' didn't
work? That's what I use all the time...

-Jonathan.
089cc91c7b1dd1d020f0746dac12a85c?d=identicon&s=25 Dave Verwer (daveverwer)
on 2006-07-05 14:01
Unfortunately it didnt, I am using Mac OS X if that matters

Jonathan Viney wrote:
> Great.
>
> Are you really sure that 'RAILS_ENV=production rake migrate' didn't
> work? That's what I use all the time...
>
> -Jonathan.
5b944180bdd935cce308d1bb57454de9?d=identicon&s=25 Mike Bethany (picklepumpers)
on 2010-09-06 09:51
Jonathan Viney wrote:
> export RAILS_ENV=production
> rake migrate
>
> Are you sure you haven't manually set the value in environment.rb ...
>
> -Jonathan.

For the newbies out there like me:

In the environment.rb file the environment type has to be in quotes like
so:

RAILS_ENV="production"
35c8fc23d4c7a40b81ce4847ff9d1eca?d=identicon&s=25 Anthony M. (anthony_m)
on 2011-02-01 21:19
Was there a resolution to this issue?  I'm having the same problem where
ruby script/console shows an error but RAILS_ENV shows production.
Bee69cfed999cd13e3bff73d472a39ee?d=identicon&s=25 Hassan Schroeder (Guest)
on 2011-02-01 22:22
(Received via mailing list)
On Tue, Feb 1, 2011 at 12:19 PM, Anthony M. <lists@ruby-forum.com>
wrote:
> Was there a resolution to this issue? I'm having the same problem where
> ruby script/console shows an error but RAILS_ENV shows production.

Given that the original message was from 2006, picked up again by
someone in 2010 -- maybe you should start a new thread with a clear
description of your problem (which doesn't match that of the OP).  :-)

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
twitter: @hassan
3dfe5e0a4a8e9d43538d46a4a379d7d4?d=identicon&s=25 Geo N. (geo_n)
on 2011-03-15 06:25
Try RAILS_ENV=production rake db:migrate
This is what im using all the time
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.