Switching from development to production?

I think I’m missing a step here, but they don’t seem to cover this in
the AWDWR book… does anybody know the various steps required to switch
from development to production mode in Rails? I’ve scoured the
application and changed everything that stands out, but the damn thing
is still running off the development database and won’t connect to the
production one. Or more accurately, since the production database is
empty, it won’t “break” for me.

sean colquhoun wrote:

I think I’m missing a step here, but they don’t seem to cover this in
the AWDWR book… does anybody know the various steps required to switch
from development to production mode in Rails? I’ve scoured the
application and changed everything that stands out, but the damn thing
is still running off the development database and won’t connect to the
production one. Or more accurately, since the production database is
empty, it won’t “break” for me.

this is in environment.rb:

Uncomment below to force Rails into production mode when

you don’t control web/app server and can’t set it the proper way

ENV[‘RAILS_ENV’] ||= ‘production’

but I don’t think that’s the proper way. I’m pretty sure it’s just a
setting in a config file somewhere like this though.

this is in environment.rb:

Uncomment below to force Rails into production mode when

you don’t control web/app server and can’t set it the proper way

ENV[‘RAILS_ENV’] ||= ‘production’

but I don’t think that’s the proper way. I’m pretty sure it’s just a
setting in a config file somewhere like this though.

Yeah, see that’s the strange part. I did that, and it’s still working. I
don’t think I’ve set it properly. There wouldn’t be anyone around who
happens to know the “proper” way, would there?

sean colquhoun wrote:

Yeah, see that’s the strange part. I did that, and it’s still working. I
don’t think I’ve set it properly. There wouldn’t be anyone around who
happens to know the “proper” way, would there?

Did you restart your server after changing the configuration? The
environment is only read on start up.

script/server -e production

Ray

What OS are you running on? Do you have an environment variable
RAILS_ENV set?

I beleive the built in web server in rails works differently than when
you deploy on Apache.

On 5/14/06, sean colquhoun [email protected] wrote:


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Jón Borgþórsson wrote:

I beleive the built in web server in rails works differently than when
you deploy on Apache.

Good point. Would there be an equivalent necessary step when setting it
up on Apache?

Ray B. wrote:

sean colquhoun wrote:

Yeah, see that’s the strange part. I did that, and it’s still working. I
don’t think I’ve set it properly. There wouldn’t be anyone around who
happens to know the “proper” way, would there?

Did you restart your server after changing the configuration? The
environment is only read on start up.

script/server -e production

Ray

Holy s**t. It worked! What does “script/server -e production” do? I was
just using script/server as always. I didn’t know you had to specify
anything in the command line to set it as well.

Nobb… When using Apache then the enviroment.rb step you did should
work,

On 5/15/06, sean colquhoun [email protected] wrote:


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails