Hello everyone, I am getting this database connection error when I run a rake task or when I try to send with ar_mailer. My app works fine that I know of but I went to import users into the database and this is what I get. rake db:load_csv_data --trace (in /home/greatcar/gcp) ** Invoke db:load_csv_data (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:load_csv_data rake aborted! Access denied for user ''root''@''localhost'' (using password: NO) /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/mysql_adapter.rb:548:in `real_connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/mysql_adapter.rb:548:in `connect'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/mysql_adapter.rb:198:in `initialize'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/mysql_adapter.rb:74:in `new'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/mysql_adapter.rb:74:in `mysql_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:223:in `send'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:223:in `new_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:188:in `checkout'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:184:in `loop'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:184:in `checkout'' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:183:in `checkout'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:98:in `connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_specification.rb:121:in `retrieve_connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ connection_adapters/abstract/connection_specification.rb:113:in `connection'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ base.rb:1220:in `columns'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ base.rb:2839:in `attributes_from_column_definition_without_lock'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ locking/optimistic.rb:55:in `attributes_from_column_definition'' /usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/ base.rb:2279:in `initialize'' /home/greatcar/gcp/lib/tasks/import.rake:9:in `new'' /home/greatcar/gcp/lib/tasks/import.rake:9 /usr/lib/ruby/gems/1.8/gems/fastercsv-1.4.0/lib/faster_csv.rb:1514:in `each'' /usr/lib/ruby/gems/1.8/gems/fastercsv-1.4.0/lib/faster_csv.rb:1017:in `foreach'' /usr/lib/ruby/gems/1.8/gems/fastercsv-1.4.0/lib/faster_csv.rb:1191:in `open'' /usr/lib/ruby/gems/1.8/gems/fastercsv-1.4.0/lib/faster_csv.rb:1016:in `foreach'' /home/greatcar/gcp/lib/tasks/import.rake:8 /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'' /usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'' /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31 /usr/local/bin/rake:19:in `load'' /usr/local/bin/rake:19 Thanks for the help, Sean McGilvray --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 25, 6:41 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello everyone, > I am getting this database connection error when I run a rake task or > when I try to send with ar_mailer. My app works fine that I know of > but I went to import users into the database and this is what I get. > > rake db:load_csv_data --trace > (in /home/greatcar/gcp) > ** Invoke db:load_csv_data (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:load_csv_data > rake aborted! > Access denied for user ''root''@''localhost'' (using password: NO)Should it be connecting as root ? Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
No, my database.yml has the correct settings: production: adapter: mysql database: DB_NAME username: USER_NAME password: PASSWORD host: 127.0.0.1 Sean McGilvray Executive Director Identity Theft Specialist Pre-Paid Legal Service''s, Inc. NYSE:PPD Phone: 760-486-1019 smcgilvray-C6gt8ZI8z3bIY2DP0bkpxA@public.gmane.org http://www.transferhome.net On Wed, Mar 25, 2009 at 11:47 AM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Mar 25, 6:41 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hello everyone, > > I am getting this database connection error when I run a rake task or > > when I try to send with ar_mailer. My app works fine that I know of > > but I went to import users into the database and this is what I get. > > > > rake db:load_csv_data --trace > > (in /home/greatcar/gcp) > > ** Invoke db:load_csv_data (first_time) > > ** Invoke environment (first_time) > > ** Execute environment > > ** Execute db:load_csv_data > > rake aborted! > > Access denied for user ''root''@''localhost'' (using password: NO) > > Should it be connecting as root ? > > Fred > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 25, 6:58 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No, my database.yml has the correct settings: >which implies that the correct environment isn''t loaded. does RAILS_ENV=production rake db:load_csv_data work any better? Fred> production: > adapter: mysql > database: DB_NAME > username: USER_NAME > password: PASSWORD > host: 127.0.0.1 > > Sean McGilvray > Executive Director > Identity Theft Specialist > Pre-Paid Legal Service''s, Inc. NYSE:PPD > Phone: 760-486-1019 > smcgilv...-C6gt8ZI8z3bIY2DP0bkpxBHnuRYL88vP@public.gmane.org://www.transferhome.net > > On Wed, Mar 25, 2009 at 11:47 AM, Frederick Cheung < > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Mar 25, 6:41 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello everyone, > > > I am getting this database connection error when I run a rake task or > > > when I try to send with ar_mailer. My app works fine that I know of > > > but I went to import users into the database and this is what I get. > > > > rake db:load_csv_data --trace > > > (in /home/greatcar/gcp) > > > ** Invoke db:load_csv_data (first_time) > > > ** Invoke environment (first_time) > > > ** Execute environment > > > ** Execute db:load_csv_data > > > rake aborted! > > > Access denied for user ''root''@''localhost'' (using password: NO) > > > Should it be connecting as root ? > > > Fred--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Yes that works. How do I fix the problem of the correct environment not loading? Sean McGilvray & Sarena Byers Director Identity Theft Specialist Pre-Paid Legal Service''s, Inc. NYSE:PPD Phone: 760-486-1019 smcgilvray-C6gt8ZI8z3bIY2DP0bkpxA@public.gmane.org http://www.transferhome.net On Wed, Mar 25, 2009 at 12:03 PM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Mar 25, 6:58 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > No, my database.yml has the correct settings: > > > which implies that the correct environment isn''t loaded. does > RAILS_ENV=production rake db:load_csv_data > work any better? > > Fred > > production: > > adapter: mysql > > database: DB_NAME > > username: USER_NAME > > password: PASSWORD > > host: 127.0.0.1 > > > > Sean McGilvray > > Executive Director > > Identity Theft Specialist > > Pre-Paid Legal Service''s, Inc. NYSE:PPD > > Phone: 760-486-1019 > > smcgilv...-C6gt8ZI8z3bIY2DP0bkpxBHnuRYL88vP@public.gmane.org://www.transferhome.net > > > > On Wed, Mar 25, 2009 at 11:47 AM, Frederick Cheung < > > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Mar 25, 6:41 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello everyone, > > > > I am getting this database connection error when I run a rake task or > > > > when I try to send with ar_mailer. My app works fine that I know of > > > > but I went to import users into the database and this is what I get. > > > > > > rake db:load_csv_data --trace > > > > (in /home/greatcar/gcp) > > > > ** Invoke db:load_csv_data (first_time) > > > > ** Invoke environment (first_time) > > > > ** Execute environment > > > > ** Execute db:load_csv_data > > > > rake aborted! > > > > Access denied for user ''root''@''localhost'' (using password: NO) > > > > > Should it be connecting as root ? > > > > > Fred > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 25, 8:24 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Yes that works. How do I fix the problem of the correct environment not > loading? >Looks like nothing set the RAILS_ENV environment variable and so it defaulted to development (things that run apps such as mongrel or passenger usually have this as an explicit option in the configuration). You need to either: - always specify RAILS_ENV when doing something - fiddle with the files appropriate to your shell and operating system so that the environment variable is always set for you. Fred> Sean McGilvray & Sarena Byers > Director > Identity Theft Specialist > Pre-Paid Legal Service''s, Inc. NYSE:PPD > Phone: 760-486-1019 > smcgilv...-C6gt8ZI8z3bIY2DP0bkpxBHnuRYL88vP@public.gmane.org://www.transferhome.net > > On Wed, Mar 25, 2009 at 12:03 PM, Frederick Cheung < > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Mar 25, 6:58 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > No, my database.yml has the correct settings: > > > which implies that the correct environment isn''t loaded. does > > RAILS_ENV=production rake db:load_csv_data > > work any better? > > > Fred > > > production: > > > adapter: mysql > > > database: DB_NAME > > > username: USER_NAME > > > password: PASSWORD > > > host: 127.0.0.1 > > > > Sean McGilvray > > > Executive Director > > > Identity Theft Specialist > > > Pre-Paid Legal Service''s, Inc. NYSE:PPD > > > Phone: 760-486-1019 > > > smcgilv...-C6gt8ZI8z3bIY2DP0bkpxBHnuRYL88vP@public.gmane.org://www.transferhome.net > > > > On Wed, Mar 25, 2009 at 11:47 AM, Frederick Cheung < > > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Mar 25, 6:41 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello everyone, > > > > > I am getting this database connection error when I run a rake task or > > > > > when I try to send with ar_mailer. My app works fine that I know of > > > > > but I went to import users into the database and this is what I get. > > > > > > rake db:load_csv_data --trace > > > > > (in /home/greatcar/gcp) > > > > > ** Invoke db:load_csv_data (first_time) > > > > > ** Invoke environment (first_time) > > > > > ** Execute environment > > > > > ** Execute db:load_csv_data > > > > > rake aborted! > > > > > Access denied for user ''root''@''localhost'' (using password: NO) > > > > > Should it be connecting as root ? > > > > > Fred--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I figured out why this was happening. I switched to RAILS_ENV=''production'' ENV["RAILS_ENV"] has been deprecated. I did not know that ENV["RAILS_ENV"] has been deprecated. Thanks for the help. Sean McGilvray Executive Director Identity Theft Specialist Pre-Paid Legal Service''s, Inc. NYSE:PPD Phone: 760-486-1019 smcgilvray-C6gt8ZI8z3bIY2DP0bkpxA@public.gmane.org http://www.transferhome.net On Wed, Mar 25, 2009 at 2:39 PM, Frederick Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On Mar 25, 8:24 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Yes that works. How do I fix the problem of the correct environment not > > loading? > > > Looks like nothing set the RAILS_ENV environment variable and so it > defaulted to development (things that run apps such as mongrel or > passenger usually have this as an explicit option in the > configuration). You need to either: > - always specify RAILS_ENV when doing something > - fiddle with the files appropriate to your shell and operating system > so that the environment variable is always set for you. > > Fred > > > Sean McGilvray & Sarena Byers > > Director > > Identity Theft Specialist > > Pre-Paid Legal Service''s, Inc. NYSE:PPD > > Phone: 760-486-1019 > > smcgilv...-C6gt8ZI8z3bIY2DP0bkpxBHnuRYL88vP@public.gmane.org://www.transferhome.net > > > > On Wed, Mar 25, 2009 at 12:03 PM, Frederick Cheung < > > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > On Mar 25, 6:58 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > No, my database.yml has the correct settings: > > > > > which implies that the correct environment isn''t loaded. does > > > RAILS_ENV=production rake db:load_csv_data > > > work any better? > > > > > Fred > > > > production: > > > > adapter: mysql > > > > database: DB_NAME > > > > username: USER_NAME > > > > password: PASSWORD > > > > host: 127.0.0.1 > > > > > > Sean McGilvray > > > > Executive Director > > > > Identity Theft Specialist > > > > Pre-Paid Legal Service''s, Inc. NYSE:PPD > > > > Phone: 760-486-1019 > > > > smcgilv...-C6gt8ZI8z3bIY2DP0bkpxBHnuRYL88vP@public.gmane.org://www.transferhome.net > > > > > > On Wed, Mar 25, 2009 at 11:47 AM, Frederick Cheung < > > > > > > frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > On Mar 25, 6:41 pm, Sean McGilvray <smcgilv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Hello everyone, > > > > > > I am getting this database connection error when I run a rake > task or > > > > > > when I try to send with ar_mailer. My app works fine that I know > of > > > > > > but I went to import users into the database and this is what I > get. > > > > > > > > rake db:load_csv_data --trace > > > > > > (in /home/greatcar/gcp) > > > > > > ** Invoke db:load_csv_data (first_time) > > > > > > ** Invoke environment (first_time) > > > > > > ** Execute environment > > > > > > ** Execute db:load_csv_data > > > > > > rake aborted! > > > > > > Access denied for user ''root''@''localhost'' (using password: NO) > > > > > > > Should it be connecting as root ? > > > > > > > Fred > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
It isn''t deprecated, it just not always set, as in the dev environment, for example. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Wed, Mar 25, 2009 at 7:19 PM, Sean McGilvray <smcgilvray-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I figured out why this was happening. > > I switched to RAILS_ENV=''production'' > > ENV["RAILS_ENV"] has been deprecated. > > I did not know that ENV["RAILS_ENV"] has been deprecated. > > > Thanks for the help. > > Sean McGilvray > Executive Director > Identity Theft Specialist > Pre-Paid Legal Service''s, Inc. NYSE:PPD > Phone: 760-486-1019 > smcgilvray-C6gt8ZI8z3bIY2DP0bkpxA@public.gmane.org > http://www.transferhome.net >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Several post that I have read say that it is deprecated. When I switched from using ENV[''RAILS_ENV''] ||= ''production'' to using RAILS_ENV=''production'' in my environment file my app now loads in production just fine. When I was using ENV[''RAILS_ENV''] ||= ''production'' it kept coming up in development. Sean McGilvray Execitve Director Identity Theft Specialist Pre-Paid Legal Service''s, Inc. NYSE:PPD Phone: 760-486-1019 smcgilvray-C6gt8ZI8z3bIY2DP0bkpxA@public.gmane.org http://www.transferhome.net 2009/3/25 Maurício Linhares <mauricio.linhares-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > It isn''t deprecated, it just not always set, as in the dev > environment, for example. > > - > Maurício Linhares > http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) > > On Wed, Mar 25, 2009 at 7:19 PM, Sean McGilvray <smcgilvray-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > I figured out why this was happening. > > > > I switched to RAILS_ENV=''production'' > > > > ENV["RAILS_ENV"] has been deprecated. > > > > I did not know that ENV["RAILS_ENV"] has been deprecated. > > > > > > Thanks for the help. > > > > Sean McGilvray > > Executive Director > > Identity Theft Specialist > > Pre-Paid Legal Service''s, Inc. NYSE:PPD > > Phone: 760-486-1019 > > smcgilvray-C6gt8ZI8z3bIY2DP0bkpxA@public.gmane.org > > http://www.transferhome.net > > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''m not really sure where you saw this, but all of those posts are clearly wrong. This is what you''re going to find at the rails initializer: RAILS_ENV = (ENV[''RAILS_ENV''] || ''development'').dup unless defined?(RAILS_ENV) The RAILS_ENV environment variable is where Rails is usually going to find out at which environment it is (this is specially true at Rake tasks), your code shouldn''t depend on it, as you should get the current Rails env by doing "Rails.env" (instead of using the constant as you are), but it is not deprecated. It''s just not meant to be used the way you were trying to. And instead of using RAILS_ENV, try using Rails.env. - Maurício Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) On Wed, Mar 25, 2009 at 7:29 PM, Sean McGilvray <smcgilvray-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Several post that I have read say that it is deprecated. When I switched > from using > > ENV[''RAILS_ENV''] ||= ''production'' > > to using > > RAILS_ENV=''production'' > > in my environment file my app now loads in production just fine. When I was > using ENV[''RAILS_ENV''] ||= ''production'' it kept coming up in development. >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---