Forum: Ruby Sqlite3-ruby ON Windows Vista with 1.9.1p129 mingw32

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Joel D. (Guest)
on 2009-06-01 05:31
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?
Joel D. (Guest)
on 2009-06-01 05:33
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*
Joel D. (Guest)
on 2009-06-01 06:40
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
Roger P. (Guest)
on 2009-06-01 17:52
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/...
GL!
-=r
Joel D. (Guest)
on 2009-06-01 20:14
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/...
> 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.
Roger P. (Guest)
on 2009-06-01 20:18
> 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.

Oops forgot steps :)
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
Joel D. (Guest)
on 2009-06-01 20:32
Roger P. wrote:
>> 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.
>
> Oops forgot steps :)
> 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.
Joel D. (Guest)
on 2009-06-01 20:39
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..
Joel D. (Guest)
on 2009-06-01 20:49
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?
Joel D. (Guest)
on 2009-06-01 20:57
I figured it out - will post in a moment.
Joel D. (Guest)
on 2009-06-01 21:09
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.
Joel D. (Guest)
on 2009-06-01 21:12
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.
Roger P. (Guest)
on 2009-06-01 21:32
> 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 :)
-=r
This topic is locked and can not be replied to.