I'm trying to setup a Rails app on an Ubuntu machine, but the app always fails with the error:

Missing these required gems: roxml

the gem is installed, and appears in gem list. The app requires a number of other gems all of which I installed without any problems, but for some reason it doesn't recognise that roxml is there.

I tried clearing out my whole ruby/rails/gem setup and starting afresh with rvm, but having gone through the process, installing all the required gems (including roxml), I'm left with the same error once again.

The full error message is:

Missing these required gems: roxml You're running: ruby at /home/tim/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby rubygems 1.6.2 at /home/tim/.rvm/gems/ree-1.8.7-2011.03, /home/tim/.rvm/gems/ree-1.8.7-2011.03@global 

(Note: I'm using ruby enterprise edition with rvm now, but I had the same problem pre-rvm with the normal ruby 1.8.7 and rubygems both installed from the Ubuntu repos.)

I have the same app working on another Ubuntu box with the same versions of everything, so something has gone screwy on this machine somewhere along the line, but I'm unsure where to look. Any help appreciated!


I'd check two things. The first is roxml installed into RVM and not as a gem on the general system? You can check by running /home/$user/.rvm/bin/rvm gem list

The other gotcha is that gem list in RVM will list gems for all installed versions of Ruby, not just the default or active Ruby. Make sure you have actually installed roxml into the Ruby you're using.

  • /home/$user/.rvm/bin/gem list gives me the same gem list which includes roxml, I can also see roxml in with all the other gems at /home/tim/.rvm/gems/ree-1.8.7-2011.03/gems/, which from the error above you'll see is definitely the ruby passenger is using – Tim Fountain Mar 24 '11 at 22:18

I was able to fix this by wrapping some of the active_support loads in a conditional:

In: /home/tim/.rvm/gems/ree-1.8.7-2011.03/lib/ruby/gems/1.8/gems/roxml-3.1.6 change the first active_support parts to:

require 'active_support'
if Gem.loaded_specs['activesupport'].version >= Gem::Version.new('3')
    require 'active_support/inflector/inflections'
    require 'active_support/core_ext/object/duplicable'
    require 'active_support/core_ext/module/delegation'
    require 'active_support/core_ext/array/extract_options'
    require 'active_support/core_ext/hash'
    require 'active_support/core_ext/string/starts_ends_with'
  • wow, I'd have never come up with that. Nice. – kashani Mar 25 '11 at 19:17
  • I can't take credit for the code, but it solved the problem. I think the issue is that roxml is written for Rails 3, where activesupport doesn't incldue all the extras; whereas the Rails 2 activesupport does, so it does when it tries to include non existent modules. That's my guess anyway. – Tim Fountain Mar 27 '11 at 0:00
  • I just had to set this up on another machine, so for anyone hitting this page off Google, the correct full path to the file that needs editing is: ~/.rvm/gems/ree-1.8.7-2011.03@rails2/gems/roxml-3.1.6/lib/roxml.rb where rails2 is your gemset name and ree-1.8.7 etc. is the ruby version you're using – Tim Fountain Apr 6 '11 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.