1

I am running a Rails 2.3.11 app on two versions of Ruby both installed with RVM. Both versions of Ruby have the exact same gems with the exact same versions for each. I uninstalled every gem that is not needed in the application.

Everything works fine with Ruby 1.8.7 (RVM 1.8.7).

Ruby 1.9.2 has two gemsets. RVM 1.9.2 has a gemset for another app. RVM 1.9.2@this_app has the gems listed below. With RVM 1.9.2@this_app I get:

Trace/BPT trap: 5

The log just stops with no indication of what the error is. Is there a gem compatibility issue? Here is the list of gems:

actionmailer (2.3.11)
actionpack (2.3.11)
activerecord (2.3.11)
activeresource (2.3.11)
activesupport (2.3.11)
devise (1.0.10)
google4r-checkout (1.0.6.1)
i18n (0.6.0)
json (1.6.1)
liquid (2.2.2)
money (3.7.1)
mysql (2.8.1)
rack (1.1.2)
rails (2.3.11)
rake (0.9.2)
rmagick (2.13.1)
warden (0.10.7)

Thanks for your help.

Jay
  • 6,206
  • 11
  • 48
  • 82
  • Check http://stackoverflow.com/a/7758657/643500 – Sully Oct 16 '12 at 17:05
  • I've already reviewed that question and answers. None of my gems are commented out. I did fresh installs of both versions of Ruby and the gems using RVM. We are using MySQL not Postgresql. I could be missing something. Is there something that I'm not seeing? – Jay Oct 16 '12 at 17:10
  • 1
    @jay Here's a guess, Can you try uninstalling that rmagick gem and then run the server again? I m saying this because rmagick uses some system related libraries for image processing and probably some of them may not be compataible with the OS that you area running and may throw this error – Raghu Oct 16 '12 at 21:03
  • @Raghu you were right. rmagick was 1/2 the problem. Full solution below. – Jay Oct 17 '12 at 05:37
  • @jay Nice to hear that you got your problem fixed. – Raghu Oct 17 '12 at 20:02

3 Answers3

1

This seems to be the list of gems installed, not what is in your Gemfile.

How are you managing the gems and gemsets? You seem to be using bundler, that's good, but how are you switching between versions of ruby and gemsets? Are you using rvm or rbenv? Do you have a Gemfile?

If you are not using bundler, it is possible to do so with rails 2.3.11, it just takes a bit of work. I would highly recommend this so you can better manage your dependencies.

I would then look at getting rid of whatever you can from the Gemfile, bundle install to update, and then try running again.

For example, I don't think you need cgi_multipart_eof_fix anymore, depending on how you are deploying.

Other gems like god, rubygems-update, and rdoc are not generally used within the app, and are likely not germane.

Andrew Kuklewicz
  • 10,621
  • 1
  • 34
  • 42
  • Took cgi_multipart_eof_fix out since posting the question. Using RVM. Will remove everything I don't absolutely need and then edit the question. Thanks. – Jay Oct 16 '12 at 17:28
  • Uninstalled every gem that isn't needed for the application including bundler. I'll worry about getting things going with bundler later. – Jay Oct 16 '12 at 17:53
1

So I take it that you can't even boot the app successfully with ruby ./script/server? It doesn't start up and then crash on the first request?

When Ruby starts crashing on you, the first thing to look at is whether you are using any binary (not pure Ruby) gems. Just looking at the above list, I believe that json, mysql, and rmagick may be binary. Comment them out temporarily from your Gemfile (if you have to comment out part of the application code, then do it). Try starting the app with bundle exec ruby ./script/server and see if it crashes. (I think json might be required by Rails, in which case you won't be able to disable that one.)

If you are only using pure Ruby gems, and Ruby is crashing on you, then you have likely found a bug in the interpreter itself. That's nothing to get scared about; if I was you I would roll my sleeves up, dive into the C source (clone it from github.com/ruby/ruby), and fix that thang! But if you don't have skills in C you might not want to attempt it.

If you want to try to debug the interpreter, the first thing is to find the point where it is crashing. For that, litter the startup code (such as application.rb, boot.rb, etc. with puts "got to #{__FILE__}:#{__LINE__}" calls and try to pinpoint exactly where the crash is happening. If need be, you can crack open your gems and add puts calls to them too (just go into the directory where RVM keeps the Ruby code and edit away).

Once you find the point where it is crashing, you can go into the C source and find the implementation of whatever platform method or construct the crash is coming from. To get more information on what is happening internally, add debug printf calls and recompile the interpreter with make && make install. (Note that messages from C-level printfs don't seem to interleave in quite the correct order with Ruby-level puts.) Temporarily edit your PATH so the newly compiled binary in your cloned ruby/bin directory will act as the system ruby.

If you can actually figure the problem out and contribute a patch to Ruby, that will mean some pretty good bragging rights for you!

Alex D
  • 29,755
  • 7
  • 80
  • 126
  • Good information here. I haven't been programing since I was 10 :=] so some of this is beyond my current abilities (see profile). Would love to know what a Canuk is doing in Zambia. – Jay Oct 17 '12 at 04:07
  • 1
    Glad to hear this helped you! I'm currently working as a volunteer in Zambia. – Alex D Oct 17 '12 at 05:42
0

Don't really like answering my own questions, but found the full answer which wasn't provided yet.

Part of the problem was rmagick compatibility. I commented out references to rmagick in the app but was still getting the same error.

The biggest contributing factor was that RVM installs rubygems 1.8.24. Anything over rubygems 1.6.x will not work with a rails 2.3.x app. The command 'rvm rubygems 1.6.2' installed a version that was compatible.

Jay
  • 6,206
  • 11
  • 48
  • 82