HOWTO: gem install sqlite3

When I entered the command

gem install sqlite3,

I am prompted to select a <Ruby> option and a <mswin32> option. The
<mswin32> option installs ok, but the <Ruby> option fails with the
message "ERROR: Failed to build gem native extension".

Do I need to install both options? If so how do I install the <ruby>
option correctly?
Which directory did gem install the <mswin32> stuff?
Do I need to put the sqlite3.dll file that can be downloaded from the
sqlite website under c:\ruby\bin?

Thank you for your help.
Basi Lio

Hi Basi

You only need to install one or the other. The <ruby> option is a package that can be used on many different OSes, but includes C code that needs to be compiled. The <mswin32> option is the same code, but the C code has been precompiled for you. This is helpful as Windows machines don't come with the tools you need to compile the C code pre-installed.

So, if you're using windows, the <mswin32> option is probably the best for you. The installed files will be in

C:\ruby\lib\ruby\gems\1.8\gems

Whichever gem package you choose, you also need the sqlite3.dll file from sqlite.org installed somewhere in your PATH. Do this before installing the gem. C:\ruby\bin is probably in your path, so you can put sqlite3.dll there, or you could put it in a system directory like C:\windows\system32. If you only use sqlite3 in ruby, putting it in the ruby directory might be easiest.

hth
alex

basi wrote:

···

When I entered the command

gem install sqlite3,

I am prompted to select a <Ruby> option and a <mswin32> option. The
<mswin32> option installs ok, but the <Ruby> option fails with the
message "ERROR: Failed to build gem native extension".

Do I need to install both options? If so how do I install the <ruby>
option correctly?
Which directory did gem install the <mswin32> stuff?
Do I need to put the sqlite3.dll file that can be downloaded from the
sqlite website under c:\ruby\bin?

Thank you for your help.
Basi Lio

Hi, Alex
Thank you for the very good explanation.
Basi

Alex Fenton wrote:

···

Hi Basi

You only need to install one or the other. The <ruby> option is a
package that can be used on many different OSes, but includes C code
that needs to be compiled. The <mswin32> option is the same code, but
the C code has been precompiled for you. This is helpful as Windows
machines don't come with the tools you need to compile the C code
pre-installed.

So, if you're using windows, the <mswin32> option is probably the best
for you. The installed files will be in

C:\ruby\lib\ruby\gems\1.8\gems

Whichever gem package you choose, you also need the sqlite3.dll file
from sqlite.org installed somewhere in your PATH. Do this before
installing the gem. C:\ruby\bin is probably in your path, so you can put
sqlite3.dll there, or you could put it in a system directory like
C:\windows\system32. If you only use sqlite3 in ruby, putting it in the
ruby directory might be easiest.

hth
alex

basi wrote:

> When I entered the command
>
> gem install sqlite3,
>
> I am prompted to select a <Ruby> option and a <mswin32> option. The
> <mswin32> option installs ok, but the <Ruby> option fails with the
> message "ERROR: Failed to build gem native extension".
>
> Do I need to install both options? If so how do I install the <ruby>
> option correctly?
> Which directory did gem install the <mswin32> stuff?
> Do I need to put the sqlite3.dll file that can be downloaded from the
> sqlite website under c:\ruby\bin?
>
> Thank you for your help.
> Basi Lio
>