[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

no such file to load -- active_record

Thufir Hawat

12/27/2007 8:42:00 PM

This works fine from my linux box, but no such luck from windows:

C:\code\dwemthys>
C:\code\dwemthys>gem install ActiveRecord
Successfully installed activerecord-2.0.2
Installing ri documentation for activerecord-2.0.2...
Installing RDoc documentation for activerecord-2.0.2...

C:\code\dwemthys>
C:\code\dwemthys>
C:\code\dwemthys>
C:\code\dwemthys>
C:\code\dwemthys>ruby db_crud_create.rb
db_crud_create.rb:2:in `require': no such file to load --
active_record (LoadErr
or)
from db_crud_create.rb:2

C:\code\dwemthys>
C:\code\dwemthys>ver

Microsoft Windows XP [Version 5.1.2600]

C:\code\dwemthys>


Could I do something from the console to figure out what's going on?




thanks,

Thufir

3 Answers

Thufir Hawat

12/27/2007 8:53:00 PM

0

A more complete example:

C:\code\dwemthys>
C:\code\dwemthys>
C:\code\dwemthys>gem search activerecord

*** LOCAL GEMS ***

activerecord (2.0.2, 1.15.6)
Implements the ActiveRecord pattern for ORM.

C:\code\dwemthys>
C:\code\dwemthys>ruby db_crud_create.rb
db_crud_create.rb:1:in `require': no such file to load --
active_record (LoadErr
or)
from db_crud_create.rb:1

C:\code\dwemthys>
C:\code\dwemthys>type db_crud_create.rb
require 'active_record'
require 'fileutils'
require 'creature'
require 'dragon'
require 'instantiate'
include Instantiate


system("rm dwemthys.db")

ActiveRecord::Base.logger = Logger.new(STDERR)
ActiveRecord::Base.colorize_logging = true

ActiveRecord::Base.establish_connection(
:adapter => "sqlite3",
:dbfile => "dwemthys.db"
)

ActiveRecord::Schema.define do
create_table :creatures do |table|
table.column :type, :string
table.column :life, :integer
table.column :strength, :integer
table.column :charisma, :integer
table.column :weapon, :integer
end
end




99.times do |index|
creature = Instantiate.randomCreature
p creature
creature.save
end

C:\code\dwemthys>


thanks,

Thufir

Frederick Cheung

12/27/2007 9:01:00 PM

0


On 27 Dec 2007, at 20:53, Thufir wrote:
>
> *** LOCAL GEMS ***
>
> activerecord (2.0.2, 1.15.6)
> Implements the ActiveRecord pattern for ORM.
>
> C:\code\dwemthys>
> C:\code\dwemthys>ruby db_crud_create.rb
> db_crud_create.rb:1:in `require': no such file to load --
> active_record (LoadErr
> or)
> from db_crud_create.rb:1
>
> C:\code\dwemthys>
> C:\code\dwemthys>type db_crud_create.rb
> require 'active_record'
You need to require rubygems first

Fred.


Thufir Hawat

12/28/2007 7:01:00 AM

0

On Fri, 28 Dec 2007 06:00:32 +0900, Frederick Cheung wrote:

> You need to require rubygems first

Thanks, it still gave errors after I did that, but I gave up. Maybe I'll
try again -- I seem to spend half my energy battling the OS.


-Thufir