Newbie question: On Windows XP I get "in `require': no such file to load -- sqlite3/sqlite3_native"

159 views
Skip to first unread message

Estoy

unread,
Jun 15, 2010, 11:54:44 AM6/15/10
to sqlite3-ruby
Hello,

When requiring sqlite3 on Windows XP I get the error "in `require': no
such file to load -- sqlite3/sqlite3_native".

I find "sqlite3_native.so" under "...\gems\1.9.1\gems\sqlite3-
ruby-1.3.0-x86-mswin32-60\lib\sqlite3\1.9" but obviously "sqlite3.rb"
does not find it.

I have no other version of sqlite3-ruby installed.

What can I be doing wrong?

All help much appreciated

Luis Lavena

unread,
Jun 15, 2010, 12:00:04 PM6/15/10
to sqlite...@googlegroups.com

You need sqlite3.dll installed:

http://blog.mmediasys.com/2009/07/06/getting-started-with-rails-and-sqlite3/

(Getting SQLite3 step)
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Estoy

unread,
Jun 15, 2010, 2:06:10 PM6/15/10
to sqlite3-ruby
Thanks for the tip. I already have it installed under the bin
directory of my Ruby installation. That should be correct, right? Any
other ideas?

On Jun 15, 6:00 pm, Luis Lavena <luislav...@gmail.com> wrote:
> On Tue, Jun 15, 2010 at 11:54 AM, Estoy <eriks...@gmail.com> wrote:
> > Hello,
>
> > When requiring sqlite3 on Windows XP I get the error "in `require': no
> > such file to load -- sqlite3/sqlite3_native".
>
> > I find "sqlite3_native.so" under "...\gems\1.9.1\gems\sqlite3-
> > ruby-1.3.0-x86-mswin32-60\lib\sqlite3\1.9" but obviously "sqlite3.rb"
> > does not find it.
>
> > I have no other version of sqlite3-ruby installed.
>
> > What can I be doing wrong?
>
> You need sqlite3.dll installed:
>
> http://blog.mmediasys.com/2009/07/06/getting-started-with-rails-and-s...

Luis Lavena

unread,
Jun 15, 2010, 2:11:22 PM6/15/10
to sqlite...@googlegroups.com
On Tue, Jun 15, 2010 at 2:06 PM, Estoy <erik...@gmail.com> wrote:
> Thanks for the tip. I already have it installed under the bin
> directory of my Ruby installation. That should be correct, right? Any
> other ideas?
>

It is a newer version? or older?

I'm using 3.6.14.1 without issues.

I've tried version 3.6.23.1 too without issues.

Please check in the PATH if any other, old version, of sqlite3.dll
could be interfering.

Also, a recommendation: using RubyInstaller releases as seems you're
using the 1.9.1 releases from garbagecollect.

Estoy

unread,
Jun 15, 2010, 4:50:03 PM6/15/10
to sqlite3-ruby
Hello again,

I'm using version 3.6.23.1 together with a Ruby installed from
"rubyinstaller-1.9.1-p378.exe".

There are many versions of "sqlite.dll" on my system but the first
thing on my path is "D:\Ruby191\bin" under which "sqlite3.dll" version
3.6.23.1 is placed.

What else should I be looking for?

On Jun 15, 8:11 pm, Luis Lavena <luislav...@gmail.com> wrote:

Luis Lavena

unread,
Jun 15, 2010, 4:54:05 PM6/15/10
to sqlite...@googlegroups.com
On Tue, Jun 15, 2010 at 4:50 PM, Estoy <erik...@gmail.com> wrote:
> Hello again,
>
> I'm using version 3.6.23.1 together with a Ruby installed from
> "rubyinstaller-1.9.1-p378.exe".
>
> There are many versions of "sqlite.dll" on my system but the first
> thing on my path is "D:\Ruby191\bin" under which "sqlite3.dll" version
> 3.6.23.1 is placed.
>
> What else should I be looking for?
>

It can't be right.

You installed RubyInstaller, which is x86-mingw32 platform, yet still
the backtrace of the error you reported indicates x86-mswin32-60
version of the gem installed.

This means you manually indicated the platform when installed? Why?

Please remove the gem and install the appropriate one: "gem install
sqlite3-ruby" should download x86-mingw32 one.

Also, are you sure that D:\Ruby191\bin appears before any other PATH,
including system32? in some cases ppl recommended install sqlite3.dll
into system32, which is plain wrong (it is not Windows 3.1)

Estoy

unread,
Jun 15, 2010, 5:01:51 PM6/15/10
to sqlite3-ruby
Hi,

I've tested both with x86-mingw32 and x86-mswin32-60. See below for
what just happened after I re-installed the x86-mingw32 version.

As for the path, I did not put Ruby first. I was just as surprised as
you to find it there. But that is where PowerShell says it is, see
below.

-------------------------------------------------------------------------------------------------------------
PS C:\Documents and Settings\erst> irb
irb(main):001:0> require 'sqlite3'
LoadError: no such file to load -- sqlite3/sqlite3_native
from D:/Ruby191/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.0-
x86-mingw32/lib/sqlite3.rb:6:in `require'
from D:/Ruby191/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.0-
x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (req
uired)>'
from D:/Ruby191/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.0-
x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
from (irb):1:in `require'
from (irb):1
from D:/Ruby191/bin/irb:12:in `<main>'

-----------------------------------

PS C:\Documents and Settings\erst> get-childitem -path env:path

Name Value
---- -----
Path D:\Ruby191\bin;C:\Program Files\Common
Files\Microsoft Shared\Windows Live;C:\WINDOWS...

----------------------------------------------------------------------------------

On Jun 15, 10:54 pm, Luis Lavena <luislav...@gmail.com> wrote:

Luis Lavena

unread,
Jun 15, 2010, 5:03:41 PM6/15/10
to sqlite...@googlegroups.com

Can you not use PowerShell?

C:\Users\Luis>ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]

C:\Users\Luis>gem list sqlite3

*** LOCAL GEMS ***

sqlite3-ruby (1.3.0 x86-mingw32)

C:\Users\Luis>where sqlite3.dll
C:\Users\Luis\Tools\bin\sqlite3.dll

C:\Users\Luis>irb


irb(main):001:0> require 'sqlite3'

=> true
irb(main):002:0>

Estoy

unread,
Jun 15, 2010, 5:09:46 PM6/15/10
to sqlite3-ruby
PowerShell does not like my call on "where", see below. I don't know
how to fix that.

PS C:\> ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]
PS C:\> gem list sqlite3

*** LOCAL GEMS ***

sqlite3-ruby (1.3.0 x86-mingw32)
PS C:\> where sqlite3.dll
Where-Object : Cannot bind parameter 'FilterScript'. Cannot convert
value "sqlite3.dll" to type "System.Management.Auto
mation.ScriptBlock". Error: "Invalid cast from 'System.String' to
'System.Management.Automation.ScriptBlock'."
At line:1 char:6
+ where <<<< sqlite3.dll
+ CategoryInfo : InvalidArgument: (:) [Where-Object],
ParameterBindingException
+ FullyQualifiedErrorId :
CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.WhereObjectCommand


On Jun 15, 11:03 pm, Luis Lavena <luislav...@gmail.com> wrote:

Luis Lavena

unread,
Jun 15, 2010, 6:09:02 PM6/15/10
to sqlite...@googlegroups.com
On Tue, Jun 15, 2010 at 5:09 PM, Estoy <erik...@gmail.com> wrote:
> PowerShell does not like my call on "where", see below. I don't know
> how to fix that.
>

Can you *not* use PowerShell?

We need to determine which DLL is being used by your system, normally,
use the command prompt.

Brandon Hauff

unread,
Jun 15, 2010, 6:11:47 PM6/15/10
to sqlite3-ruby
Hi,

I was experiencing this same problem. I downloaded a new copy of
sqlite3 from http://www.sqlite.org/sqlitedll-3_6_23_1.zip and
extracted it to the bin folder of my ruby 1.8.7. That fixed it! I
plan to test it on 1.9.1 and the 1.9.2 preview tomorrow.

Thanks,

Brandon

Estoy

unread,
Jun 15, 2010, 6:33:29 PM6/15/10
to sqlite3-ruby
Ok. I misunderstood.

I don't want to sound stupid but the command prompt does not recognize
the command "where". I can run it in cygwin, of course, but then I
won't see the same path, or?

On Jun 16, 12:09 am, Luis Lavena <luislav...@gmail.com> wrote:

Luis Lavena

unread,
Jun 15, 2010, 6:39:39 PM6/15/10
to sqlite...@googlegroups.com
On Tue, Jun 15, 2010 at 6:33 PM, Estoy <erik...@gmail.com> wrote:
> Ok. I misunderstood.
>
> I don't want to sound stupid but the command prompt does not recognize
> the command "where". I can run it in cygwin, of course, but then I
> won't see the same path, or?
>

Oh, Windows XP then, sorry. we should have started by that.

I understood that PowerSheel did not understood it, and since I don't
use it, didn't now how to proceed and say to you except "don't use it"

Please provide me the output of:

SET PATH
SET HOME
gem env
gem list sqlite3-ruby -d

Also, try as mentioned by Brandon: download latest binaries and put
them in Ruby bin folder.

Estoy

unread,
Jun 16, 2010, 4:32:42 AM6/16/10
to sqlite3-ruby
Hi,

Brandon was right. Reloading the dll fixed the problem. I wonder why.
I only got the old one yesterday.

Do you still want to see the info you asked for or should we just
leave it?

Anyway, thanks a lot for all your help.

On Jun 16, 12:39 am, Luis Lavena <luislav...@gmail.com> wrote:

Luis Lavena

unread,
Jun 16, 2010, 7:22:58 AM6/16/10
to sqlite...@googlegroups.com
On Wed, Jun 16, 2010 at 4:32 AM, Estoy <erik...@gmail.com> wrote:
> Hi,
>
> Brandon was right. Reloading the dll fixed the problem. I wonder why.
> I only got the old one yesterday.

It might be a corrupt binary?

> Do you still want to see the info you asked for or should we just
> leave it?
>

I think if the issue is solve, let's keep the other questions for the
next time ;-)

> Anyway, thanks a lot for all your help.
>

You're welcome. Glad you solved it.

Reply all
Reply to author
Forward
0 new messages