MissingSourceFile: no such file to load -- sqlite3/database

This is a discussion on MissingSourceFile: no such file to load -- sqlite3/database within the RUBY forums in Programming Languages category; Hi, I'm using active_record and sqlite3-ruby (gem) modules. When I try to connect to sqlite3 database, I get a error : "MissingSourceFile: no such file to load -- sqlite3/database" I have "sqlite3/database.rb" in my $: path as shown below. Does anyone know what this means or what causes it ? My environment is : - ruby 1.8.7 (2008-08-08 patchlevel 71) [i686-linux] - gem 1.2.0 [gems] - activerecord (2.1.0) - activesupport (2.1.0) - sqlite3-ruby (1.2.2) Thanks in advance for any help. Below are shown the steps of how this error occurs and some information about database and RUBYLIB. --- snip --- ...

Go Back   Application Development Forum > Programming Languages > RUBY

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-26-2008, 11:11 AM
João Macaíba
Guest
 
Default MissingSourceFile: no such file to load -- sqlite3/database

Hi,

I'm using active_record and sqlite3-ruby (gem) modules. When I try to
connect to sqlite3 database, I get a error :

"MissingSourceFile: no such file to load -- sqlite3/database"

I have "sqlite3/database.rb" in my $: path as shown below.

Does anyone know what this means or what causes it ?

My environment is :

- ruby 1.8.7 (2008-08-08 patchlevel 71) [i686-linux]
- gem 1.2.0

[gems]
- activerecord (2.1.0)
- activesupport (2.1.0)
- sqlite3-ruby (1.2.2)

Thanks in advance for any help.

Below are shown the steps of how this error occurs and some information
about database and RUBYLIB.

--- snip ---
> irb

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'active_record'
=> true
irb(main):003:0> ActiveRecord::Base.establish_connection({:adapter =>
'sqlite3', :dbfile => '../../db/per.db'})
=> #<ActiveRecord::Base::ConnectionSpecification:0xb7 81bb60
@adapter_method="sqlite3_connection",
@config={:dbfile=>"../../db/per.db", :adapter=>"sqlite3"}>
irb(main):004:0> class Per_Configuration < ActiveRecord::Base
irb(main):005:1> end
=> nil
irb(main):006:0> pc = Per_Configuration.find(1)
MissingSourceFile: no such file to load -- sqlite3/database
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
`require'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
`new_constants_in'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
`require'
from
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2/lib/sqlite3.rb:1
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`gem_original_require'
from
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
`require'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:354:in
`new_constants_in'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/dependencies.rb:509:in
`require'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/kernel/requires.rb:7:in
`require_library_or_gem'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/kernel/reporting.rb:11:in
`silence_warnings'
from
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/kernel/requires.rb:5:in
`require_library_or_gem'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in
`sqlite3_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in
`send'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in
`connection='
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:in
`retrieve_connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
`connection'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2693:in
`quoted_table_name'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1371:in
`find_one'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1362:in
`find_from_ids'
from
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:537:in
`find'
from (irb):6
from :0irb(main):007:0>
--- snip ---

--- snip ---
> sqlite3 ../../db/per.db

SQLite version 3.4.2
Enter ".help" for instructions
sqlite> select * from Per_Configurations;
1|Ports_Dir|/usr/per|text
2|Buffer_Repositories|buffer/repositories|text
sqlite>
--- snip ---



--- snip ---
irb(main):007:0> $:.each do |path|
irb(main):008:1* puts path
irb(main):009:1> end
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/tzinfo-0.3.8
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/memcache-client-1.5.0
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/xml-simple-1.0.11
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/vendor/builder-2.1.2
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib
/var/lib/gems/1.8/gems/sqlite3-ruby-1.2.2/lib
/home/macaiba/development/projects/per/lib
/lib
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/bin
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/bin
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2/bin
/usr/local/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2/lib
/usr/local/lib/ruby/site_ruby/1.8
/usr/local/lib/ruby/site_ruby/1.8/i686-linux
/usr/local/lib/ruby/site_ruby
/usr/local/lib/ruby/vendor_ruby/1.8
/usr/local/lib/ruby/vendor_ruby/1.8/i686-linux
/usr/local/lib/ruby/vendor_ruby
/usr/local/lib/ruby/1.8
/usr/local/lib/ruby/1.8/i686-linux
Reply With Quote
  #2  
Old 08-26-2008, 12:10 PM
Jos Backus
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database

On Wed, Aug 27, 2008 at 12:11:05AM +0900, Joo Macaba wrote:
> Hi,
>
> I'm using active_record and sqlite3-ruby (gem) modules. When I try to
> connect to sqlite3 database, I get a error :
>
> "MissingSourceFile: no such file to load -- sqlite3/database"
>
> I have "sqlite3/database.rb" in my $: path as shown below.
>
> Does anyone know what this means or what causes it ?


Try the advice given here:

http://wuhai.wordpress.com/2008/07/0...lite3database/

It would be REALLY nice if the maintainers would release 1.2.3 with a fix.

--
Jos Backus
jos at catnook.com

Reply With Quote
  #3  
Old 08-26-2008, 03:54 PM
Erik Veenstra
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database


Are you sure you've read access on the file?

gegroet,
Erik V.

Reply With Quote
  #4  
Old 08-27-2008, 12:30 AM
David Masover
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database

On Tuesday 26 August 2008 11:10:37 Jos Backus wrote:
> On Wed, Aug 27, 2008 at 12:11:05AM +0900, Joo Macaba wrote:
> > Hi,
> >
> > I'm using active_record and sqlite3-ruby (gem) modules. When I try to
> > connect to sqlite3 database, I get a error :
> >
> > "MissingSourceFile: no such file to load -- sqlite3/database"
> >
> > I have "sqlite3/database.rb" in my $: path as shown below.
> >
> > Does anyone know what this means or what causes it ?

>
> Try the advice given here:
>
>

http://wuhai.wordpress.com/2008/07/0...lite3database/

"Sorry, no posts matched your criteria."

> It would be REALLY nice if the maintainers would release 1.2.3 with a fix.


True. Or anything, really -- this is damned sloppy.

I'm seriously considering Amalgalite (spelling?), just because it seems
actively maintained.

Short answer: The permissions on that file are wrong. They're wrong in the
gem. You'll have to fix them manually.

Reply With Quote
  #5  
Old 08-27-2008, 12:34 AM
Jeremy Kemper
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database

On Tue, Aug 26, 2008 at 9:30 PM, David Masover <ninja@slaphack.com> wrote:
> On Tuesday 26 August 2008 11:10:37 Jos Backus wrote:
>> On Wed, Aug 27, 2008 at 12:11:05AM +0900, Joo Macaba wrote:
>> > Hi,
>> >
>> > I'm using active_record and sqlite3-ruby (gem) modules. When I try to
>> > connect to sqlite3 database, I get a error :
>> >
>> > "MissingSourceFile: no such file to load -- sqlite3/database"
>> >
>> > I have "sqlite3/database.rb" in my $: path as shown below.
>> >
>> > Does anyone know what this means or what causes it ?

>>
>> Try the advice given here:
>>
>>

> http://wuhai.wordpress.com/2008/07/0...lite3database/
>
> "Sorry, no posts matched your criteria."
>
>> It would be REALLY nice if the maintainers would release 1.2.3 with a fix.

>
> True. Or anything, really -- this is damned sloppy.
>
> I'm seriously considering Amalgalite (spelling?), just because it seems
> actively maintained.
>
> Short answer: The permissions on that file are wrong. They're wrong in the
> gem. You'll have to fix them manually.


Good news:

1.2.3 was just released!

jeremy

Reply With Quote
  #6  
Old 08-27-2008, 12:47 AM
David Masover
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database

On Tuesday 26 August 2008 23:34:37 Jeremy Kemper wrote:

> Good news:
>
> 1.2.3 was just released!


Seems to be fixed -- or at least, not broken. Thanks!



Reply With Quote
  #7  
Old 08-27-2008, 01:23 AM
Jos Backus
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database

On Wed, Aug 27, 2008 at 01:30:36PM +0900, David Masover wrote:
> On Tuesday 26 August 2008 11:10:37 Jos Backus wrote:
> http://wuhai.wordpress.com/2008/07/0...lite3database/
>
> "Sorry, no posts matched your criteria."


Hey, it worked right before I posted it. :-)

Glad to hear 1.2.3 has been released.

--
Jos Backus
jos at catnook.com

Reply With Quote
  #8  
Old 08-27-2008, 09:22 AM
João Macaíba
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database

Jos Backus wrote:
> On Wed, Aug 27, 2008 at 12:11:05AM +0900, Joo Macaba wrote:
>
>> Hi,
>>
>> I'm using active_record and sqlite3-ruby (gem) modules. When I try to
>> connect to sqlite3 database, I get a error :
>>
>> "MissingSourceFile: no such file to load -- sqlite3/database"
>>
>> I have "sqlite3/database.rb" in my $: path as shown below.
>>
>> Does anyone know what this means or what causes it ?
>>

>
> Try the advice given here:
>
> http://wuhai.wordpress.com/2008/07/0...lite3database/
>


About the changes on "ruby.h", they already there under ruby 1.8.7.

But, shame on me, I have not realized the missing 'r' permission for
'others':

--- snip ---
-rw-rw--w- 1 root root 24774 2008-08-26 18:54 database.rb
--- snip ---

Changing this permission as suggested in the link, have solved the
problem

> It would be REALLY nice if the maintainers would release 1.2.3 with a fix.
>
>


Thanks for the help/time, Jos !

Regards,
João Macaíba.

Reply With Quote
  #9  
Old 08-27-2008, 09:24 AM
João Macaíba
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database

Erik Veenstra wrote:
> Are you sure you've read access on the file?
>
> gegroet,
> Erik V.
>
>

I haven't had:

--- snip ---
-rw-rw--w- 1 root root 24774 2008-08-26 18:54 database.rb
--- snip ---

I've corrected that

Regards,
João Macaíba.

Reply With Quote
  #10  
Old 08-27-2008, 05:45 PM
Jos Backus
Guest
 
Default Re: MissingSourceFile: no such file to load -- sqlite3/database

On Wed, Aug 27, 2008 at 10:22:02PM +0900, Joo Macaba wrote:
> Thanks for the help/time, Jos !


Welcome. But 1.2.3 doesn't run out of the box either, at least on CentOS 5 with
the stock Ruby 1.8.5.

/usr/bin/ruby: symbol lookup error:
/usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.3/lib/sqlite3_api.so:
undefined symbol: RSTRING_PTR

$ nm sqlite3_api.so | grep RSTRING
U RSTRING_LEN
U RSTRING_PTR

http://github.com/jamis/sqlite3-ruby...690e5987744cd2
says it fixes linking against Ruby 1.8.5 but the sqlite3_api_wrap.c generated
by swig (from extconf.rb) defines the necessary RSTRING_* macros too late in
the generated code. Moving the defines up in the generated file works around
the problem, but I'm not sure what the right fix is as the defines already sit
at the top of the sqlite3_api.i file.

--
Jos Backus
jos at catnook.com

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:32 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.