Defect #11248

rake aborted! uninitialized constant RAILS_ENV trying to update Database

Added by Alessio Pollero over 10 years ago. Updated over 9 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution:Cant reproduce Affected version:


I'm trying to update redmine from 1.3.0 to 2.0.3 when i arrive at step 4 Update the Database i run this command :

rake db:migrate RAILS_ENV=production

i get this error :

(in /usr/share/redmine)
/var/lib/gems/1.8/gems/rake- warning: already initialized constant RUBY
/var/lib/gems/1.8/gems/rake- warning: already initialized constant LN_SUPPORTED
rake aborted!
uninitialized constant RAILS_ENV

(See full trace by running task with --trace)

Why ?

How can i solve this error ? my database is postgreSQL...


#1 Updated by Jean-Philippe Lang over 10 years ago

  • Resolution set to Cant reproduce

#2 Updated by Alessio Pollero over 10 years ago

I have the problem on my installation rather then simply setting the issue as not reproducible, you could have asked for more information ...

Do you need more information to investigate the problem ?

I have updated from version 1.3.0 and i followed the steps in the upgrade guide, but i get the error ... Should i upgrade to 1.4.4 and then to 2.0.3 ?


#3 Updated by Ki Won Kim over 10 years ago

I have same error and evironments.
and I remove plugins folder, then ok.
Maybe old plugins were effected.

#4 Updated by CĂ©lestin Matte over 10 years ago

I had the same problem trying to install a plugin for Redmine 1.x on Redmine 2.x.
The problem may come from one of your plugins, try checking running the db migration with --trace to see where the error comes from.
I solved the problem simply by changing "RAILS_ENV" to "Rails.env" where the error came from (in my case, in plugins/<plugin_name>/init.rb:4).


#5 Updated by Jean-Baptiste Barth over 9 years ago

  • Status changed from New to Closed
  • Priority changed from Urgent to Normal
Closing this issue, I hope it's now resolved for you. Just a few points :
  • there's no need to upgrade to 1.4.x before 2.x
  • there are high chances it's related to one of your plugins that's not compatible with Redmine 2.x
  • if the issue still occurs without any plugin, please read SubmittingBugs and provide detailed informations about how to reproduce


Also available in: Atom PDF