SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rails won't load gems

    Hi,

    I'm working on a Rails application. However, for some reason it won't load gems.

    I created a library to communicate with the eNom API, and am using LibXML to parse the response. It works when I test it by itself, but won't work when I use it through a model. If I try requiring xml or libxml, it says the file couldn't be loaded. If I just try using it, since I enabled it in config/environment.rb, it says uninitialized constant.

    If I load script/console, I can call LibXML or just XML just fine. However it just won't work in the application itself.

    Gems are installed and working. I defined RUBYOPT in /etc/bashrc to load rubygems. They are working in ruby applications that aren't using rails. However in rails itself it won't work.

    Version information:
    • ruby 1.8.7
    • gem 1.3.7
    • rails 2.3.5
    • libxml-ruby 1.1.4


    Any help is much appreciated.

  2. #2
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post an example of the code you use in a model to require the LibXML? Also the error output would be useful.

  3. #3
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ReggieB View Post
    Can you post an example of the code you use in a model to require the LibXML? Also the error output would be useful.
    Oh, this was solved long ago. I'm not patient enough to wait three weeks without finding a way to solve something.

    I'd post what I did, but I'm not really sure. It was a lot of trial and error, but it just started working.

    Thanks though.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •