error rake generate_session_store installing redmine-1.1.1 - ruby

My company need to upgrade their current Redmine1.1.1 server. In order to avoid productions issue, I am trying to recreate a working instance with identical version. That's why I can't use standard solution which mainly modify the gems or rail version.
I need to create an instance of a redmine-1.1.1 CentOS6 server with the following rubygems version:
[root#localhost redmine1]# rpm -qa |grep ruby
rubygem-rack-1.1.0-2.el6.noarch
rubygem-daemon_controller-1.1.5-1.el6.noarch
rubygems-1.3.7-5.el6.noarch ruby-ri-1.8.7.374-4.el6_6.i686
ruby-1.8.7.374-4.el6_6.i686 rubygem-rake-0.8.7-2.1.el6.noarch
ruby-mysql-2.8.2-1.el6.i686 ruby-irb-1.8.7.374-4.el6_6.i686
rubygems-devel-1.3.7-5.el6.noarch ruby-devel-1.8.7.374-4.el6_6.i686
rubygem-passenger-3.0.21-11.el6.i686
rubygem-passenger-native-libs-3.0.21-11.el6.i686
ruby-rdoc-1.8.7.374-4.el6_6.i686 ruby-docs-1.8.7.374-4.el6_6.i686
rubygem-passenger-native-3.0.21-11.el6.i686
ruby-libs-1.8.7.374-4.el6_6.i686 rubygem-fastthread-1.0.7-2.2.i686
I followed the tutorials below in order to recreate the redmine install.
https://www.redmine.org/projects/redmine/wiki/Redmine+Apache+Passenger_InstallOnRedHat
http://www.redmine.org/projects/redmine/wiki/HowTo_install_Redmine_on_CentOS_5
I got this error and knowing that I can't downgrade my gems, what are the other options to overcome this?
[root#localhost redmine1]# rake generate_session_store
rake aborted!
undefined method `source_index' for Gem:Module
/var/www/redmine1/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:21:in
`add_frozen_gem_path' /var/www/redmine1/config/boot.rb:47:in
`load_initializer' /var/www/redmine1/config/boot.rb:38:in `run'
/var/www/redmine1/config/boot.rb:11:in `boot!'
/var/www/redmine1/config/boot.rb:122 /var/www/redmine1/Rakefile:4
/usr/local/rvm/gems/ruby-1.8.7-head#redmine111/bin/ruby_executable_hooks:15
(See full trace by running task with --trace)
What are the necessary complements to help you understand this issue?

Related

Issues installing/updating Bundler

I have tried this a number of different ways. First I tried with RVM and it was just error after error and missing dependencies. Then I tried Rbenv and it was very much the same.
Now, I have a combo of chruby and ruby-install to handle my versions of Ruby, but I can't update Bundler.
It says that I am currently on 1.17.2, but I need 1.17.3.
How do I upgrade this? I have searched everywhere, but all the solutions seems to be for RVM.
When I try to update Bundler this is the error that I get:
$ gem update bundler
ERROR: Loading command: update (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I don't know what is causing this or how to get around it. Any help would be appreciated as I can't seem to find anything describing what is happening.
So, it turns out that I had multiple versions of Bundler installed on my machine and, somehow, two of them were simultaneously set to the default version.
Manually finding the installed versions, deleting them and then reinstalling the desired version seemed to fix the issue.
The key is using a Ruby manager (RVM, rbenv, etc.) and ensuring that any installation of a Ruby version and/or gems are done at either a system level or inside of a project as required.

How to fix "uninitialized constant Gem::GEM_PRELUDE_SUCKAGE" in RubyGems tasks

My RubyGems isn't working, throwing an error which goes as follows, triggering (nearly) on any Gem task:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:1081:in `<top (required)>': uninitialized constant Gem::GEM_PRELUDE_SUCKAGE (NameError)
from <internal:gem_prelude>:1:in `require'
from <internal:gem_prelude>:1:in `<compiled>'
I'm new to Ruby / RubyGems / installing Ruby and all I know is that an uninitialized constant is essentially a undefined variable. It could also be possible that it's something with Ruby itself, although the ->Gem:GEM<-_PRELUDE_SUCKAGE points me to RubyGems.
In a nutshell, I installed a bunch of Ruby things (think RVM, rbenv, etc.) to develop Ruby on Rails, as I thought it would be a good way to learn Ruby.
Well, after going through a long and tedious process to upgrade Ruby to 2.6.3, then downgrade to 2.5.5 and then 2.4.0, then back up to 2.5.5 and solving downgrade issues, RubyGems throws the error. I settled on 2.5.5 because 2.6.3 caused errors and 2.4.0 was too early of a version.
It's causing all sorts of errors, like HAML not compiling and Rails not making a controller. I really don't know what's happening.
If I run gem install [gem name], it throws the error. Running rails generate controller [name] index (for those not familiar to Rails this creates, well, a controller) it throws the error. Doing anything really with the gem command causes the error, except for gem server.
If I upgrade back up to the latest Ruby version, I fear that my gem command will go all wonky again and I'll have to go through another day of troubleshooting versions. How do I fix this, or at least get rid of the message so I can create things again?
I had this happen to me just today. It seems, somehow, my ruby version had been corrupted. When I ran rvm list version 2.5.1 was listed as 'broken'. I had to uninstall 2.5.1 fully (using sudo even in my case) to get to a clean slate.
Then, when attempting to reinstall, rvm was giving me all kinds of grief after a new gpg key which I initialy couldn't get to install properly (hint).
After a clean wipe of ruby 2.5.1, updating rvm to latest version and reinstalling, I got this error: Error running 'env GEM_HOME=/ruby-2.5.1#global GEM_PATH= /Users/user/.rvm/rubies/ruby-2.5.1/bin/ruby -d /Users/user/.rvm/src/rubygems-3.0.8/setup.rb --no-document',.
It appears that an update to MacOSX deprecated a version of OpenSSL which causes some issues. I ended up following this thread and ran rvm gemset create global --default and then bundle install to get passed the Gem errors.
Honestly, rails is supposed to be easier than this. I wish docker was easier to reason about sometimes. These are the kinds of issues docker supposedly promises to fix eh?

toy/doc undefined method 'available?'

I'm attempting to build local Ruby documentation as suggested here:
https://github.com/toy/doc
However when I use the default Rakefile I get the following:
[Documentation]$ rake build
configuring and updating: 100.0%
rake aborted!
undefined method `available?' for Gem:Module
/Users/snowcrash/.rvm/gems/ruby-2.0.0-p195/gems/sdoc-0.2.20/lib/sdoc/json_backend.rb:9:in `<top (required)>'
Any suggestions?
I don't know much about ruby (and even less about the gem ecosystem built up around it), but I believe a possible workaround for this issue is to find what gems the project requires and manually install them. In the case of this particular project, it looks like you need the gem "fspath".
At the project root, type
gem install fspath
and try re-running rake.
I honestly don't know the actual root cause of the issue, other than that presumably, your version of the 'gem' program is probably > v2, while some other program (rake?) expects it to be older and still support the "available?" method.
If installing "fspath" doesn't fix the issue, you could try downgrading your version of gem by doing
gem install -v [some version of gem older than v2]
Check gem install --help for more info on this.
This is just for future visitor who has the same issue.
As ekremkaraca said, you can just solve this by downgrading rubygems.
rvm install --force rubygems 1.4.2

Error showing while creating the database structure on Redmine

I am now setting up my Redmine 2.1.0 in Debian. When I ran this RAILS_ENV=production rake db:migrate in Redmine directory. It's showing an error like this
rake aborted!
Invalid preference factor: 3.0
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
My Ruby version is 1.8.7
When I gave this command "ruby -e 'p 0.3". it prints 3.0. I don't know what the issue was. How can I set up Redmine 2.1.0 in my organization?
Seems you have an issue with your specific ruby.
rvm is your friend. Try installing 1.9.3-head, create gemset for redmine and proceed installation.
Big advantage of RVM approach is a fact that new rubies install does not affect system ruby no applications using it.

rake aborted! stack level too deep [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Rails 3.0 & Ruby 1.9.2rc: Rake commands return 'already initialized constant' & stack level too deep errors. Any ideas
Am using Ruby version 1.9.1 on windows vista. Am getting the rake aborted error for any rake commands am using. This does not happen in all my app folder. Its happening only on a specific app folder.
C:\rails_project\stunetwork>rake db:reset
(in C:/rails_project/stunetwork)
rake aborted!
stack level too deep
C:/Ruby191/lib/ruby/gems/1.9.1/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rak
efile'
(See full trace by running task with --trace)
try placing bundle exec in front of the rake command.
bundle exec rake -T
You need to update your gem.
I met this error with gem '1.8.10', and fixed by upgrading to 1.8.16
gem update --system
I only had this problem with ruby-1.9.2-p180 via rvm.
Switching to ruby-1.9.2-p0 fixed the problem.
try "rvm use 1.9.2-p0"
The stack of the calls can depend on the gems you install (some gems monkeypatch the rails tasks) which explains why you would encounter this on a specific app and not on others.
On a unix system you could try using the ulimit command to increase your stack size. On the windows side I haven't found a solution yet.
Depending on which release of ruby you use on windows you may want to ask the maintainers how to increase the stack.
For ruby installer you will need to install the mingw compile environment, clone the github repository and recompile the ruby you use (not very sexy I admit).
I just encountered this exact error message on Ubuntu, and was able to solve it by downgrading rubygems from 1.8.3 to 1.7.1.
There is nice post by Yehuda Katz that explains why without bundle exec there can be version conflicts:
http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/
There is also bundle install --binstubs command that allows to version-safely run rake db:reset like this: bin/rake db:reset.

Resources