Sqlite3-ruby ON Windows Vista with 1.9.1p129 mingw32


#1

I’m using the ming compiled 1.9.1 p 129 successfully on Vista and I even
managed to get mysql to work (lots of headaches but I did it). However,
I can’t get sqlite3-ruby to work.

I’ve tried the following:

gem install sqlite3-ruby -v=1.2.3 --platform=mswin32
– it installs the gem correctly but I get "unable to find sqlite3.dll

Downloaded the latest sqlite3.exe,.dll
I’ve added the ALL to ruby\bin
I’ve added the .exe to C:\Windows
I’ve added the .dll to C:\Windows\System32

… same issues …

I’ve tried the following:

gem install sqlite3-ruby -v=1.2.3 --platform=mingw32
– ERROR: failed to build gem native extension

If I try any rake commands I get cannot find the sqlite3.dll…

Anyone get this to work successfully?


#2

As a further note, if I didn’t need to use sqlite3, I wouldn’t.
However, I’m reading “Foundation Rails 2” (great book) which happens to
have database examples starting in chapter 4 that use sqlite3. So, if I
want to work through anything in this book, I have to have this loaded.

sigh


#3

Correction on the error message (it should read instead)

no driver for sqlite3 found

run IRB:

require ‘sqlite3’
=> true

SQLite3::Database.new( ‘mytest_db.sqlite3’ )
RuntimeError: no driver for sqlite3 found


#4

J. D. wrote:

I’m using the ming compiled 1.9.1 p 129 successfully on Vista and I even
managed to get mysql to work (lots of headaches but I did it). However,
I can’t get sqlite3-ruby to work.

I’ve tried the following:

gem install sqlite3-ruby -v=1.2.3 --platform=mswin32
– it installs the gem correctly but I get "unable to find sqlite3.dll

Yep that one’s tough, too. Unfortunately when you do the
–platform=mswin32 it install the 1.8.6 binaries for it, which is
probably not what you want (rubygems’ guys are working on a fix for
that…I hope).

Until then you’ll get to compile your own.
Here’s some recent instructions on that one
http://programming-gone-awry.blogspot.com/2009/05/how-to-install-sqlite3-binaries-on-ruby.html
GL!
-=r


#5

Roger P. wrote:

Until then you’ll get to compile your own.
Here’s some recent instructions on that one
http://programming-gone-awry.blogspot.com/2009/05/how-to-install-sqlite3-binaries-on-ruby.html
GL!
-=r

Hi Roger,

Looking at the following instructions:

  1. install wget or curl in path
  2. install unzip.exe
    (http://gnuwin32.sourceforge.net/packages/unzip.htm) in path
  3. install rake compiler [gem install rake-compiler]
    put the bin folder in GCC in the devkit to my path [i.e. if you installed the straight devkit [1] then “set
    path=C:\ruby\devkit\gcc\3.4.5\bin;%PATH%”]
  4. rake vendor:sqlite3
  5. rake native gem
  6. gem install pkg/xxx.gem

… perhaps I’m too literal and I’m not following these instructions
(keep in mind I write technical documentation so I take it literally
when I read something or try to follow something)

  1. I downloaded and installed Wget (which was put in C:\Program
    Files\GnuWin32\Bin (added this directory to my path environment in
    windows)
  2. I downloaded and installed unzip.exe into a new folder called
    C:\Ruby\unzip\ and added this folder to my path environment in windows.
  3. Performed gem install rake-compiler => successful.
  4. I have the devkit installed in C:\Ruby\devkit so I checked and
    confirmed and added the path C:\Ruby\devkit\gcc\3.4.5\bin to my path
    environment in windows.
  5. Opened up a Command Prompt and typed rake vendor:sqlite3 from
    “anywhere” in the command prompt.

Rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rake…

Again, I’m sorry if I perform operations literally but if my step #5
differs from Step #4 it’s because there’s nothing in there explaining
where to begin rake…

Any assistance would be appreciated.


#6

Roger P. wrote:

  1. Opened up a Command Prompt and typed rake vendor:sqlite3 from
    “anywhere” in the command prompt.

Rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rake…

Again, I’m sorry if I perform operations literally but if my step #5
differs from Step #4 it’s because there’s nothing in there explaining
where to begin rake…

Any assistance would be appreciated.

Oops forgot steps :slight_smile:
5) install msysgit
6) git clone git://github.com/luislavena/sqlite3-ruby.git
cd into it
then run the said rake commands (old number 5)
GL!
-=r

Okay making some progress but still stuck.

I had git already installed so that saved a step.

  1. Ran git clone instructions ->successful
  2. CD into the sqlite3-ruby directory
  3. Ran rake vendor:sqlite3 =>successful
  4. Rank rake native gem =>

mkdir -p tmp/i386-mingw32/sqlite3_api
cd tmp/i386-mingw32/sqlite3_api
C:/Ruby/bin/ruby.exe -I .
C:/Users/Joel/sqlite3-ruby/ext/sqlite3-api/extconf.rb
–with-sqlite3-dir=C:/Users/Joel/sqlite3-ruby/vendor/sqlite3
checking for fdatasync() in -lrt… no
checking for sqlite3.h… no
*** C:/Users/Joel/sqlite3-ruby/ext/sqlite3-api/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.


#7

I think the issue is actually with :

rake vendor:sqlite3

It’s failing as well. It looks like it doesn’t recognize unzip.

Keep in mind when I installed unzip and placed it in my path, the only
files listed in that directory are:

zip.exe
zipnote.exe
zipcloak.exe
zipsplit.exe

I don’t even see an unzip.exe…


#8
  1. Opened up a Command Prompt and typed rake vendor:sqlite3 from
    “anywhere” in the command prompt.

Rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rake…

Again, I’m sorry if I perform operations literally but if my step #5
differs from Step #4 it’s because there’s nothing in there explaining
where to begin rake…

Any assistance would be appreciated.

Oops forgot steps :slight_smile:
5) install msysgit
6) git clone git://github.com/luislavena/sqlite3-ruby.git
cd into it
then run the said rake commands (old number 5)
GL!
-=r


#9

Found a copy of unzip.exe and placed it in the folder.

Moved the sqlite3 folder to root of C: and changed it to sql to make it
easier to run commands.

C:\sql

DIR shows there is a vendor folder

C:\sql\vendor

DIR shows:

C:\sql\vendor\sqlite3
C:\sql\vendor\sqlitedll-3_6_14_1.zip

Run rake vendor:sqlite3

unzip C:/sql/vendor/sqlitedll-3_6_14_1.zip
unzip: can’t find either C:/sql/vendor/sqlitedll-3_6_14_1.zip or
C:/sql/vendor/sqlitedll-3_6_14_1.zip.zip, so there.

Go directly into the folder…

C:\sql\vendor\

Run unzip sqlitedll-3_6_14_1.zip

unzip: can’t find either C:/sql/vendor/sqlitedll-3_6_14_1.zip or
C:/sql/vendor/sqlitedll-3_6_14_1.zip.zip, so there.

It actually says, so there… hehe.

So, what do you think the issue is?


#10

Okay summarizing:

The reason why I had issues with unzip was because I had downloaded some
very old .exe called UNZIP.exe which did not work properly. (I checked
for viruses just in case but the file looks fine) - I use kaspersky so
no rootkit detections or malware thankfully. Checked my
C:\windows\system32 for any new .exe or .dlls and none and my registry
checkes out.

Found the correct unzip.exe file package online and once I downloaded
and installed that - everything worked fine using the remainder
instructions above.

I also tested out the db creation and it worked.

so, I’m good to go.


#11

Tested netbeans 6.5 IDE with everything:

Running ruby 1.9.1 p129
Mysql => perfect
sqlite3 => perfect

I’m good to go now!

Thanks a bunch mate. I have a full install on windows working fine
thankfully.


#12

The reason why I had issues with unzip was because I had downloaded some
very old .exe called UNZIP.exe which did not work properly.

Glad to hear you got it working–and thanks for the feedback on the
howto :slight_smile:
-=r


#13

I figured it out - will post in a moment.