Wrong Ruby version in Redmine

Added by Aris De Natale over 5 years ago

Hello to all.

I'm experiencing an unusual problem, that given me headache from 3 days.

I installed new version of Ruby:

root@server:/usr/local/rvm/wrappers/ruby-2.1.0# rvm info

ruby-2.1.0:

  system:
    uname:       "Linux www2 3.5.0-45-generic #68-Ubuntu SMP Mon Dec 2 21:58:52 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux" 
    system:      "ubuntu/12.10/x86_64" 
    bash:        "/bin/bash => GNU bash, version 4.2.37(1)-release (x86_64-pc-linux-gnu)" 
    zsh:         " => not installed" 

  rvm:
    version:      "rvm 1.25.17 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]" 
    updated:      "22 hours 32 minutes 8 seconds ago" 
    path:         "/usr/local/rvm" 

  ruby:
    interpreter:  "ruby" 
    version:      "2.1.0p0" 
    date:         "2013-12-25" 
    platform:     "x86_64-linux" 
    patchlevel:   "2013-12-25 revision 44422" 
    full_version: "ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]" 

  homes:
    gem:          "/usr/local/rvm/gems/ruby-2.1.0" 
    ruby:         "/usr/local/rvm/rubies/ruby-2.1.0" 

  binaries:
    ruby:         "/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby" 
    irb:          "/usr/local/rvm/rubies/ruby-2.1.0/bin/irb" 
    gem:          "/usr/local/rvm/rubies/ruby-2.1.0/bin/gem" 
    rake:         "/usr/local/rvm/gems/ruby-2.1.0/bin/rake" 

  environment:
    PATH:         "/usr/local/rvm/gems/ruby-2.1.0/bin:/usr/local/rvm/gems/ruby-2.1.0@global/bin:/usr/local/rvm/rubies/ruby-2.1.0/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" 
    GEM_HOME:     "/usr/local/rvm/gems/ruby-2.1.0" 
    GEM_PATH:     "/usr/local/rvm/gems/ruby-2.1.0:/usr/local/rvm/gems/ruby-2.1.0@global" 
    MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-2.1.0" 
    IRBRC:        "/usr/local/rvm/rubies/ruby-2.1.0/.irbrc" 
    RUBYOPT:      "" 
    gemset:       "" 

Rails version:

root@server:~# rails -v
Rails 4.0.2

But on Redmine 2.4.3 info page, it shows:

Environment:
  Redmine version                2.4.3.stable
  Ruby version                   1.8.7-p358 (2012-02-08) [x86_64-linux]
  Rails version                  3.2.16
  Environment                    production
  Database adapter               MySQL
SCM:
  Subversion                     1.7.5
  Git                            1.7.10.4
  Filesystem                     
Redmine plugins:
  redmine_close_button           0.0.8
  redmine_issue_checklist        2.0.5
  redmine_issue_detailed_tabs_time 0.1.0
  redmine_workload               1.0.1

I made some investigations, and I reached that the issue is on Apache, that loads the wrong (old) version of the passenger module that calls the old ruby interpreter.

So, at first instance, I tried to unload the passenger module from Apache, using a2dismod command; Command was succesful, and said that module is now disabled. But listing the modules enabled I still see passenger there (shared):

root@server:~# a2dismod passenger
Module passenger already disabled

root@server:~# apache2ctl -M
Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 version_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 rpaf_module (shared)
 setenvif_module (shared)
 status_module (shared)
 passenger_module (shared)
Syntax OK

root@server:~#

How this can happen? means that Apache is still running old Passenger module compiled with old ruby path; How is possible to disable that module and provide to Apache the correct path to get interpreter?

I need to install some plugins; they require to do "bundle install"; command goes successfully, but the bundles are installed for 2.1.0 version of Ruby, not for the one used by redmine. Of course it causes crashes of Redmine, because the pathes of the bundles are not found by interpreter when I restart redmine with plugin in the folder.

I need to make redmine work with Ruby 2.1.0 interpreter, but I really don't know how to make it work.

This is my vhost config of redmine:


<VirtualHost *:80>
 ServerName tracker.arsgate.com
 DocumentRoot /path/to/redmine/public
 ServerAdmin user@example.com
 LogLevel warn
 ErrorLog /var/log/apache2/redmine_error
 CustomLog /var/log/apache2/redmine_access combined
#PassengerRuby /usr/local/rvm/wrappers/ruby-2.1.0/ruby
#PassengerRuby /usr/local/rvm/rubies/ruby-2.1.0/bin/ruby
#RailsEnv production
#RailsAllowModRewrite off

 SetEnv GEM_HOME=/usr/local/rvm/gems/ruby-2.1.0

# PassengerRuby /usr/local/rvm/rubies/ruby-2.1.0/bin/ruby

 <Directory /path/to/redmine/public>
 Options Indexes FollowSymLinks MultiViews
 AllowOverride all
 Order allow,deny
 allow from all
 RailsBaseURI /redmine-2.4.3/redmine-2.4.3
 PassengerResolveSymlinksInDocumentRoot on
RewriteCond %{ENV:REDIRECT_STATUS} 200

 </Directory>
</VirtualHost>

I also paste the logs of Apache error file:

[Tue Feb 11 15:03:59 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.6-1ubuntu1.5 Phusion_Passenger/3.0.15 configured -- resuming normal operations

But I installed passenger 4. Why it still loads the 3 version?

At the end of all: can Redmine 2.4.3 work with Ruby 2.1.0?

Thanks in advance for anyone that will help.