Switching from development to production?


#1

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.


#2

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.


#3

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?


#4

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


#5

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


#6

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

On 5/14/06, sean colquhoun removed_email_address@domain.invalid wrote:


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


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


#7

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?


#8

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.


#9

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

On 5/15/06, sean colquhoun removed_email_address@domain.invalid wrote:


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails