[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: curious erros

Felix Windt

9/2/2007 7:19:00 PM

> From: mghohoo [mailto:mghohoo@gmail.com]
> Sent: Sunday, September 02, 2007 11:45 AM
> To: ruby-talk ML
> Subject: curious erros
>
> After I run a simple program like this:
> --------------------------------------------------------------
> ---------
> require 'rubygems'
> require 'active_record'
>
> ActiveRecord::Base.establish_connection(
> :adapter => "sqlite3",
> :dbfile => "D:\\sqlite\\crawl.config"
> )
> class Webdata < ActiveRecord::Base
>
> end
>
> web=Webdata.find(1)
> puts web.dns
> --------------------------------------------------------------
> ---------
> I see such a message.What had happend?When I use mysql,there is no
> problem.Is there any problem when I install ruby?This sqlite3 adpt is
> the default one in activerecord gem.
> thanks.
> --------------------------------------------------------------
> ---------
> >ruby webs.rb
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `gem_original_require': no such file to load -- sqlite3
> (MissingSourceFile)
> from
> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
> `require'
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
> active_support/dependencies.rb:495:in `require'
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
> active_support/dependencies.rb:342:in `new_constants_in'
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
> active_support/dependencies.rb:495:in `require'
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
> active_support/core_ext/kernel/requires.rb:7:in
> `require_library_or_gem'
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
> active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
> from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/
> active_support/core_ext/kernel/requires.rb:5:in
> `require_library_or_gem'
> from
> c:/ruby/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
> sqlite_adapter.rb:14:in `sqlite3_connection'
> from
> c:/ruby/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
> abstract/connection_specification.rb:262:in `send'
> from
> c:/ruby/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
> abstract/connection_specification.rb:262:in
> `connection_without_query_cache='
> from
> c:/ruby/lib/ruby/site_ruby/1.8/active_record/query_cache.rb:
> 54:in `connection='
> from
> c:/ruby/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
> abstract/connection_specification.rb:230:in `retrieve_connection'
> from
> c:/ruby/lib/ruby/site_ruby/1.8/active_record/connection_adapters/
> abstract/connection_specification.rb:78:in `connection'
> from
> c:/ruby/lib/ruby/site_ruby/1.8/active_record/base.rb:1023:in
> `find_one'
> from
> c:/ruby/lib/ruby/site_ruby/1.8/active_record/base.rb:1014:in
> `find_from_ids'
> from c:/ruby/lib/ruby/site_ruby/1.8/active_record/base.rb:419:in
> `find'
> from aa.rb:12
> >Exit code: 1
>


You need to install the ruby bindings to sqlite3. One way to do that would
be installing the sqlite3-ruby gem.

HTH,

Felix