cannot load file Creature.rb

Discussion in 'Ruby' started by thufir, Mar 23, 2012.

  1. thufir

    thufir Guest

    Am I using require incorrectly? Or doing my gems wrong? Why won't
    creatures.rb load Creature.rb?


    thufir@dur:~/ruby/dwemthys$
    thufir@dur:~/ruby/dwemthys$ ruby creatures.rb
    /home/thufir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/
    rubygems/custom_require.rb:36:in `require': cannot load such file --
    Creature (LoadError)
    from /home/thufir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/
    site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from creatures.rb:2:in `<main>'
    thufir@dur:~/ruby/dwemthys$
    thufir@dur:~/ruby/dwemthys$ cat creatures.rb
    require 'rubygems'
    require 'Creature'

    thufir@dur:~/ruby/dwemthys$
    thufir@dur:~/ruby/dwemthys$ cat Creature.rb
    require 'rubygems'
    require 'active_record'

    class Creature < ActiveRecord::Base

    attr_accessor :life, :strength, :charisma, :weapon

    end
    thufir@dur:~/ruby/dwemthys$
    thufir@dur:~/ruby/dwemthys$ which ruby
    /home/thufir/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
    thufir@dur:~/ruby/dwemthys$
    thufir@dur:~/ruby/dwemthys$ which gem
    /home/thufir/.rvm/rubies/ruby-1.9.3-p125/bin/gem
    thufir@dur:~/ruby/dwemthys$
    thufir@dur:~/ruby/dwemthys$ rvm --version

    rvm 1.10.3 by Wayne E. Seguin <>, Michal Papis
    <> [https://rvm.beginrescueend.com/]

    thufir@dur:~/ruby/dwemthys$
    thufir@dur:~/ruby/dwemthys$ type rvm | head -1
    rvm is a function
    thufir@dur:~/ruby/dwemthys$
    thufir@dur:~/ruby/dwemthys$



    thanks,

    Thufir
     
    thufir, Mar 23, 2012
    #1
    1. Advertising

  2. thufir

    thufir Guest

    On Fri, 23 Mar 2012 16:00:05 +0000, thufir wrote:

    > require 'Creature'


    Ok, didn't know about the new relative_require.




    -Thufir
     
    thufir, Mar 23, 2012
    #2
    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.

Share This Page