RAILS_ENV = "production" does not work

I recently deployed my application and it works fine except for one
minor detail: I cannot change the environment from development to
production.
My environment.rb has the first line

#1
ENV[“RAILS_ENV”] = “production”

Opening the console and checking the environment with “ruby
script/about” shows that I am in development mode, however.

Then I added this line

#2
RAILS_ENV = ENV[“RAILS_ENV”]

But when I run “ruby script/about” with the second line #2 then I get an
error message because the RAILS_ENV constant has been initialized
before, already. I am really puzzled why that is (where can it possibly
have been set?).

Perhaps someone else had a similar problem and could point me in the
right direction. Thanks a lot.

try RAILS_ENV=‘production’

ENV[“RAILS_ENV”] has been deprecated.

-Matt

http://railsontherun.com

On Dec 3, 6:37 am, Markus K. [email protected]

Thanx for your reply, Matt.
When I use RAILS_ENV = “production” I get the error message:

[…] warning: already initialized constant RAILS_ENV
/var/lib/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:263:in
load_missing_constant': uninitialized constant Rails::Info (NameError) from /var/lib/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:inconst_missing’
from /var/lib/gems/1.8/gems/rails-1.2.6/lib/commands/about.rb:2
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:inrequire’
from script/about:5

I don’t really understand what’s going wrong here…

When I use irb and type “RAILS_ENV” I get the right environment, though.
So, I suspect there is only a problem with the the about.rb file
(probably something wrong with Rails::Info).

I think my problem is similar. It works in development on my local
machine but in production it gives me similar errors.
Would love to know what to do to fix this.

Elle

On Dec 4, 5:38 am, Markus K. [email protected]

On Dec 3 2007, 11:38 am, Markus K. <ruby-forum-incom…@andreas-
s.net> wrote:

    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in

gem_original_require' from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in require’
from script/about:5

I don’t really understand what’s going wrong here…

Posted viahttp://www.ruby-forum.com/.

Same thing…dev ./script/about works, prod ./script/about does not.