ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
Windows XP problem with Ruby, gem sqlite3-ruby, and SQLite3
by SunSw0rd other posts by this author
Jul 1 2009 2:10PM messages near this date
windows api using a handle to focus input | Re: Windows XP problem with Ruby, gem sqlite3-ruby, and SQLite3
Varients of this problem have been posted before. However none of the
solutions have worked for me. Therefore I started with a clean slate.
(1) uninstalled and reinstalled Ruby (version 1.8.6) into standard
directory C:\Ruby using standard installer.
(2) Went to http://sqlite.org/download.html and downloaded
sqlite-3_6_16.zip and sqlitedll-3_6_16.zip to C:\SQLite. Extracted the
files there.
(3) Copied sqlite3.dll and sqlite3.exe to C:\Ruby\bin
(4) Launched a command window, went to C:\Ruby\bin, and executed: “gem
install sqlite3-ruby -v 1.2.3”
Results were positive:
===
C:\Ruby\bin> gem install sqlite3-ruby -v 1.2.3
Successfully installed sqlite3-ruby-1.2.3-x86-mswin32
1 gem installed
Installing ri documentation for sqlite3-ruby-1.2.3-x86-mswin32...
Installing RDoc documentation for sqlite3-ruby-1.2.3-x86-mswin32...
===

No problems detected so far. So I created a very simple script in C:
\Ruby\bin called sql1.rb:
===
require 'sqlite3'
db = SQLite3::Database.new( "test.db" )
sql = <<SQL
    create table the_table (
      a varchar2(30),
      b varchar2(30)
    );

    insert into the_table values ( 'one', 'two' );
    insert into the_table values ( 'three', 'four' );
    insert into the_table values ( 'five', 'six' );
SQL
db.execute_batch( sql )
db.execute( "select * from test" )
===

Result is this:
===
C:\Ruby\bin> ruby sql1.rb
./sqlite3.dll: 127: The specified procedure could not be found.   -
Init_sqlite3 (LoadError)
./sqlite3.dll
        from sql1.rb:2
===

Same error occurs if the only line in the Ruby script is the: require
'sqlite3'

Machine is an XP machine. Does not have a C:\windows\system32
directory but just in case there was some unknown hard coded
dependency I created that and copied the two sqlite files there
(the .dll and .exe). That did not fix the problem.

The problem is not that C:\Ruby\bin is not in the PATH variable, I
execute "set" and can see it right in the path.

Does anyone have any idea where the root cause of the problem might be?
Thread:
SunSw0rd
SunSw0rd
SunSw0rd
Luis Lavena
Michael Linfield

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved