[RubyGems] require fails the first time called and works the second time

Discussion in 'Ruby' started by Brian Takita, Jul 25, 2005.

  1. Brian Takita

    Brian Takita Guest

    Hello,

    The first time I try to require a library, I get a "No such file to
    load". The second time I do the require, it works.
    Does anybody know how I can fix this?

    Here is my irb session:

    irb(main):001:0> require 'data_view'
    LoadError: No such file to load -- dataview
    from
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
    `require__'
    from
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
    `require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:182:in
    `activate'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:181:in `each'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:181:in
    `activate'
    from
    c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:26:in
    `require'
    from (irb):1
    irb(main):002:0> require 'data_view'
    => true

    Thank you,
    Brian Takita
    Brian Takita, Jul 25, 2005
    #1
    1. Advertising

  2. Brian Takita

    Brian Takita Guest

    Re: require fails the first time called and works the second time

    Arg...Theres something wrong with my rake file. I'll post the real
    problem and solution when I fix it.
    Brian Takita, Jul 25, 2005
    #2
    1. Advertising

  3. Brian Takita

    Brian Takita Guest

    Re: require fails the first time called and works the second time

    AFAICT the problem is that I did not have a file named dataview.rb in
    my library folder.
    To solve this issue, I created a dataview.rb file that contains:
    > require 'data_view'


    Now I can require 'dataview', instead of require 'data_view' to use
    this library.
    Brian Takita, Jul 25, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frederic Rentsch

    Operator += works once, fails if called again

    Frederic Rentsch, Oct 2, 2006, in forum: Python
    Replies:
    2
    Views:
    301
    Frederic Rentsch
    Oct 3, 2006
  2. Adam Wilson
    Replies:
    1
    Views:
    200
    Brian Candler
    Jan 26, 2010
  3. http://links.i6networks.com

    Why '' Is Matched First Time, Not Second Time

    http://links.i6networks.com, Aug 21, 2004, in forum: Perl Misc
    Replies:
    10
    Views:
    155
    Sherm Pendley
    Aug 22, 2004
  4. Replies:
    7
    Views:
    258
    A. Sinan Unur
    Feb 14, 2006
  5. yelipolok
    Replies:
    4
    Views:
    241
    John W. Krahn
    Jan 27, 2010
Loading...

Share This Page