Configuration problems with Ruby’s XmlSimple

I like Ruby gems, I can see the resemblance to Perl’s old CPAN idea. CPAN always drove me crazy since everything you pulled down then had say 8-10 more libraries that it required. Till this day I still avoid often avoid perl just because of the pain of constantly installing libraries to get simple things to work.

I ran into one of those too easy to go wrong type problems. Just two easy steps to use XmlSimple:

  1. 1
    sudo gem install xml-simple
  2. Run a ruby script with
    1
    require 'xmlsimple'

Two hours later I still get the same useless error that doesn’t really have any google hits:

`require': no such file to load -- xmlsimple

4 comments to Configuration problems with Ruby’s XmlSimple

  • Hi Ed,

    Not sure what platform you’re on, but you may need to close your terminal/command line session before using a newly installed gem.

    I also ran into a problem the other day where I ended up with two gem repositories — I was installing to one location and rails was looking at a different place. the GEM_HOME env variable helped in that case.

    Good luck!
    Luke

  • I’m on Mac OS X 10.4, and I figured out my problem here. Thanks for the ideas though, as it forced me to spend more time reading the Ruby Gems manual where I was able to find the answer.

  • Bala

    Wrong:

    # sudo gem gem install xml-simple

    Correct:
    sudo gem install xml-simple

  • Administrator

    Yeah, that was a editor typo. I actually used:

    1
    sudo gem install xml-simple

    Thanks for the catch.