I do not have much experience with Rails. Back on Wednesday I was told to upgrade Redmine, and upgrade the plugins. I've been working on this for 3 days now and it has been a shock to see how far Rails still has to go to enter the modern era of package management.
I am on Centos 6.3. At first I upgraded to Ruby 1.8.7 because that is what is in the Centos repository, and that was enough to upgrade Redmine. But when I got to the redmine_backlogs plugin, I realized I needed a newer version of Ruby. Getting Ruby 1.9.3 on Centos is not easy. I tried 4 different tutorials before I got something that worked. I have a ton of strange paths that I have had to fix manually.
I tried Nginx with Passenger and could not get it to work, so later I did Phusion Passenger Standalone.
Now I've got Rails 3.2.11 running. I suppose I'll have to patch this given all the security problems in the land of Rails these last few weeks.
I just upgraded to the newest Redmine, which should be 2.2.
I think my Nginx is using a different version of Ruby than what I want. If I do this:
/opt/nginx/sbin/nginx -V
then I see this:
built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/opt/nginx --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt=-Wno-error --with-pcre=/tmp/root-passenger-14193/pcre-8.31 --add-module=/usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/ext/nginx
Which looks like it is using Ruby 1.8 instead of Ruby 1.9.3, yes?
If I do this:
/opt/nginx/sbin/nginx -s stop
and then:
/opt/nginx/sbin/nginx
I restart nginx but if I then refresh in my browser, I get:
Passenger encountered the following error:
The application spawner server exited unexpectedly: Unexpected end-of-file detected.
Exception class:
PhusionPassenger::Rack::ApplicationSpawner::Error
Backtrace:
# File Line Location
0 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/rack/application_spawner.rb 135 in `start'
1 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 253 in `spawn_rack_application'
2 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 132 in `lookup_or_add'
3 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 246 in `spawn_rack_application'
4 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 82 in `synchronize'
5 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server_collection.rb 79 in `synchronize'
6 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 244 in `spawn_rack_application'
7 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 137 in `spawn_application'
8 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/spawn_manager.rb 275 in `handle_spawn_application'
9 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 357 in `__send__'
10 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 357 in `server_main_loop'
11 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/lib/phusion_passenger/abstract_server.rb 206 in `start_synchronously'
12 /usr/lib64/ruby/gems/1.8/gems/passenger-3.0.19/helper-scripts/passenger-spawn-server 99
I have seen a comment from here related with this issue:
i solved the problem after checking several installation procedures (god bless vm's and snapshots). the normal useraccount and the apache user uses another ruby version (1.8) then root does (1.9.3). now everything works fine.
but I would not know how to fix it on my server.
I tried to look in my Nginx logs:
tail /var/log/nginx/error.log
but the most recent error is from February 5th, so I suspect that once I switched over to using Phusion Passenger, the error logs were moved to a new location, but I am not sure how to find the location where Nginx stores its error log, now that Phusion Passenger is controlling it. Any suggestions?
UPDATE:
I found the new Nginx error log here:
/opt/nginx/logs/error.log
The errors are:
2013/02/11 17:02:15 [notice] 25295#0: signal process started
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
2013/02/11 17:06:23 [notice] 25360#0: signal process started
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
2013/02/11 17:10:47 [notice] 25433#0: signal process started
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
2013/02/11 17:13:35 [notice] 25522#0: signal process started
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
2013/02/11 17:16:31 [notice] 25598#0: signal process started
/usr/local/rvm/gems/ruby-1.9.3-p385/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
If I do this:
echo $PATH
, then:
/usr/local/rvm/gems/ruby-1.9.3-p385/bin:/usr/local/rvm/gems/ruby-1.9.3-p385@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p385/bin:/usr/local/rvm/bin:/sbin:/bin:/usr/sbin:/usr/bin
From Passenger docs page:
The default value is ruby, meaning that the Ruby interpreter will be looked up according to the PATH environment variable.
So you would think it would use ruby 1.9.3 instead of 1.8
If I look in config.ru
, I see:
require::File.expand_path('../config/environment', __FILE__)
run RedmineApp::Application
Any suggestions?