Hello all,
I am trying to get Ruby to work with SQLite under Windows. I
installed the Sqlite-ruby gem, but whenever I do this:
require ‘sqlite’
I get an error saying that sqlite.dll was not found. I have downloaded
de SQLite DLL, and placed it in the Windows folder, the system32 folder
and inside
C:\ruby\lib\ruby\gems\1.8\gems\sqlite-ruby-2.2.3-x86-mswin32\lib.
But the error persists. Where must I place this DLL to get SQLite to
work?
Thanks for any info.
Omar C. wrote:
Hello all,
I am trying to get Ruby to work with SQLite under Windows. I
installed the Sqlite-ruby gem, but whenever I do this:
require ‘sqlite’
I get an error saying that sqlite.dll was not found. I have downloaded
de SQLite DLL, and placed it in the Windows folder, the system32 folder
and inside
C:\ruby\lib\ruby\gems\1.8\gems\sqlite-ruby-2.2.3-x86-mswin32\lib.
But the error persists. Where must I place this DLL to get SQLite to
work?
Thanks for any info.
There is difference beetween sqlite.dll and sqlite3.dll. Which are you
using.
I have downloaded mine from SQLite Download Page and
putted windows binaries into ruby bin directory whic is BTW in widows
path.
Are you using sqlite3-ruby gem?
by
TheR
On Nov 28, 10:04 am, Omar C. [email protected] wrote:
C:\ruby\lib\ruby\gems\1.8\gems\sqlite-ruby-2.2.3-x86-mswin32\lib.
Forgot to mention:
When you require, please do this:
require ‘rubygems’
require ‘sqlite3’
Since you’re installing an old SQLite/Ruby bindings for SQLite 2, but
installing the gem for SQLite 3.
Follow the tutorial link I sent before and should get you started.
On Nov 28, 10:04 am, Omar C. [email protected] wrote:
C:\ruby\lib\ruby\gems\1.8\gems\sqlite-ruby-2.2.3-x86-mswin32\lib.
But the error persists. Where must I place this DLL to get SQLite to
work?
Thanks for any info.
Please follow this tutorial:
http://blog.mmediasys.com/2009/07/06/getting-started-with-rails-and-sqlite3/
You don’t need to install Rails, but just for you to setup a proper
Ruby version (either 1.8.6 or 1.9.1) and setup SQLite3 properly to
work with Ruby.
Note that sqlite3-ruby version 1.2.5 was released officially, so you
don’t need to indicate --source at the installation command.
Please look for “RubyInstaller Release Candidate 1” and not the old
One-Click Installer packages. RubyForge sucks at the package listing
and filtering, so please pay attention to what you download.
Hope this helps,
Luis L. wrote:
On Nov 28, 10:04�am, Omar C. [email protected] wrote:
C:\ruby\lib\ruby\gems\1.8\gems\sqlite-ruby-2.2.3-x86-mswin32\lib.
Forgot to mention:
When you require, please do this:
require ‘rubygems’
require ‘sqlite3’
Since you’re installing an old SQLite/Ruby bindings for SQLite 2, but
installing the gem for SQLite 3.
Follow the tutorial link I sent before and should get you started.
Hi again,
Thanks for your replies. I made a mistake, I thought I was installing
the gem for ‘sqlite’ when in reality it was ‘sqlite3’. The DLL I copied
was sqlite3.dll. This time I placed it in
C:\ruby\lib\ruby\1.8\i386-mswin32.
I tested using irb:
C:\Ruby\gem_install>irb
irb(main):001:0> require’rubygems’
=> false
irb(main):002:0> require’sqlite3’
LoadError: 127: The specified procedure could not be found. -
Init_sqlite3
C:/Ruby/lib/ruby/1.8/i386-mswin32/sqlite3.dll
from C:/Ruby/lib/ruby/1.8/i386-mswin32/sqlite3.dll
from
C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `re
quire’
from (irb):2
irb(main):003:0> exit
When I use the rdoc server, I can see the ‘rubygems’ gem installed, I
don’t understand why it returns false. I will check out the link you
sent and see if it helps, in the meantime, if you have any other
suggestions I’ll be glad to know what they are. Thanks again.
On Nov 28, 1:49 pm, Omar C. [email protected] wrote:
C:\ruby\lib\ruby\1.8\i386-mswin32.
from C:/Ruby/lib/ruby/1.8/i386-mswin32/sqlite3.dll
You should not put the DLL inside the gem folder structure.
Please follow the instructions as I commented in a previous post.
Luis L. wrote:
On Nov 28, 1:49�pm, Omar C. [email protected] wrote:
C:\ruby\lib\ruby\1.8\i386-mswin32.
� � � � from C:/Ruby/lib/ruby/1.8/i386-mswin32/sqlite3.dll
You should not put the DLL inside the gem folder structure.
Please follow the instructions as I commented in a previous post.
Hi again,
I finally got it to work, but had to do a clean ruby install. I
copied the dll, def and sqlite.exe files to th ruby bin directory, and
after some more internet digging, I found a post about ruby searching
for extensions in the bin folder, and to run the script outside that
directory. After doing so, it worked correctly, I was even able to do
“rake db:create” for a Rails test app. Thanks for all your help.
Luis L. wrote:
On Nov 28, 10:04�am, Omar C. [email protected] wrote:
C:\ruby\lib\ruby\gems\1.8\gems\sqlite-ruby-2.2.3-x86-mswin32\lib.
Forgot to mention:
When you require, please do this:
require ‘rubygems’
require ‘sqlite3’
Since you’re installing an old SQLite/Ruby bindings for SQLite 2, but
installing the gem for SQLite 3.
Follow the tutorial link I sent before and should get you started.
Hi, I followed the steps on the link you sent, but I still get the same
error message. I am doing this with Ruby 1.8 (The O. Click Installer
version). Any other suggestions are welcome.