curious erros

M

mghohoo

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top