Patch #8588
closedRakefile for rake 0.9.2
0%
Description
Hello,
when you are using rake 0.9.2 and try to generate the session store you will get following error:
(in /var/www/redmine) rake aborted! uninitialized constant Rake::DSL /usr/lib/ruby/1.8/rake.rb:2503:in `const_missing' /var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/tasklib.rb:8 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' /var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/testtask.rb:4 /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' /var/www/redmine/Rakefile:7 /usr/lib/ruby/1.8/rake.rb:2383:in `load' /usr/lib/ruby/1.8/rake.rb:2383:in `raw_load_rakefile' /usr/lib/ruby/1.8/rake.rb:2017:in `load_rakefile' /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:2016:in `load_rakefile' /usr/lib/ruby/1.8/rake.rb:2000:in `run' /usr/lib/ruby/1.8/rake.rb:2068:in `standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:1998:in `run' /usr/bin/rake:28
The mistake is fixed with adding require 'rake/dsl_definition' before require 'rake' in the Rakefile.
Files
Updated by Szymon Połom over 13 years ago
I can confirm this issue with Redmine 1.2.0 on Debian Squeeze with Rake 0.8.7.
The provided patch solved my problem.
Updated by Jean-Baptiste Barth over 13 years ago
- Status changed from New to 7
- Assignee set to Jean-Baptiste Barth
Did you notice any other incompatibilities with rake 0.9.2 ? I saw other warnings, and even errors but it was on an experimental branch with bundler enabled. I'll have a look at this anyway. For now, I updated the wiki to encourage the use of rake 0.8.7 (RedmineInstall).
Updated by john s. over 13 years ago
on which rakefile file i have to make the patch?
best regards john s.
Updated by Bruno Medeiros over 13 years ago
Same issue on Ubuntu 11.04, rake 0.8.7
The patch fixed the problem.
My output after patch was:
root@brunojcm-htpc:/opt/redmine/current# rake generate_session_store (in /opt/redmine/redmine-1.2) /var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY /var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
Hope it helps.
Updated by Etienne Massip over 13 years ago
Bruno Medeiros wrote:
Same issue on Ubuntu 11.04, rake 0.8.7
Obviously you're using rake 0.9.2 too.
Updated by Bruno Medeiros over 13 years ago
Etienne Massip wrote:
Bruno Medeiros wrote:
Same issue on Ubuntu 11.04, rake 0.8.7
Obviously you're using rake 0.9.2 too.
Something is weird here... If i run rake -V
in terminal, I got:
root@ubuntu-redmine:/opt/redmine# rake -V rake, version 0.8.7
But when I run some rake command, it shows 0.9.2 as version i the stacktrace...
root@ubuntu-redmine:/opt/redmine/current# RAILS_ENV=production rake db:migrate (in /opt/redmine/redmine-1.2) /var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY /var/lib/gems/1.8/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED ...
Anyway, the patch fixed the problem.
Updated by Anonymous over 13 years ago
If you have both versions installed, you can run rake 0.8.7 rb:migrate.
Updated by Anonymous over 13 years ago
If you have both versions installed, you can run rake _0.8.7_ db:migrate
.
Updated by yannick quenec'hdu over 12 years ago
Nathan Smith wrote:
If you have both versions installed, you can run
rake _0.8.7_ db:migrate
.
I have the same problem with Redmine 2.0
update patch, like this :
!/usr/bin/env rake
require File.expand_path('../config/application', __FILE__)
RedmineApp::Application.load_tasks
require 'rake/dsl_definition'
require 'rake'
require 'rake/testtask'
the command rake generate_secret_token
work very well with rake 0.9.2, not with 0.8.7
Updated by Jean-Baptiste Barth over 12 years ago
- Assignee deleted (
Jean-Baptiste Barth)
Updated by C. X. over 12 years ago
Please use next time the pre tag. Otherwise someone can't see the underscores of your File constant.
I only needed following:
require File.expand_path('../config/application', __FILE__) require 'rake/dsl_definition' RedmineApp::Application.load_tasks
But I got two warnings now:
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/file_utils.rb:9: warning: already initialized constant RUBY /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/file_utils.rb:86: warning: already initialized constant LN_SUPPORTED
yannick quenec'hdu wrote:
I have the same problem with Redmine 2.0
update patch, like this :
!/usr/bin/env rake
require File.expand_path('../config/application', FILE)
RedmineApp::Application.load_tasks
require 'rake/dsl_definition'
require 'rake'
require 'rake/testtask'the command
rake generate_secret_token
work very well with rake 0.9.2, not with 0.8.7
Updated by Ashwin Sewbaran over 12 years ago
Bruno Medeiros wrote:
Etienne Massip wrote:
Bruno Medeiros wrote:
Same issue on Ubuntu 11.04, rake 0.8.7
Obviously you're using rake 0.9.2 too.
This is incorrect.
The gem rake version you use is version 0.9.2, but the system rake version is 0.8.7.
This is something that happens when you install rake using the default repositories.
If you are running on debian you can fix this problem by uninstalling the current rake version with:
apt-get uninstall rake
afterwards download the version you require (0.9.2+) from:
http://packages.debian.org/sid/all/rake/download
This fixed the following warning messages for me:
/var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/file_utils.rb:9: warning: already initialized constant RUBY /var/lib/gems/1.8/gems/rake-0.9.2.2/lib/rake/file_utils.rb:86: warning: already initialized constant LN_SUPPORTED
Updated by Jean-Philippe Lang almost 12 years ago
- Status changed from 7 to New
Assigned issue with no assignee back to New status.
Updated by Go MAEDA about 6 years ago
- Status changed from New to Closed
I think we don't have to take care of this issue now because rake 0.9.2 is too old and we are using newer versions of rake.