gem install sqlite3-ruby still not working

43 views
Skip to first unread message

Libber

unread,
Jan 3, 2012, 4:52:10 AM1/3/12
to rubyonra...@googlegroups.com
Dear all,
        I am trying to install ruby on rails...but the sqlite3-ruby part has been the trouble giver. I read almost every trouble shoot given in various forums in internet but nothing worked? 

I am attaching the output of the command here too. Please help me. 

sudo gem install sqlite-ruby-2.2.3.gem 
Building native extensions.  This could take a while...
ERROR:  Error installing sqlite-ruby-2.2.3.gem:
        ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb
checking for main() in -lsqlite... no
checking for sqlite.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/local/bin/ruby
        --with-sqlite-dir
        --without-sqlite-dir
        --with-sqlite-include
        --without-sqlite-include=${sqlite-dir}/include
        --with-sqlite-lib
        --without-sqlite-lib=${sqlite-dir}/lib
        --with-sqlitelib
        --without-sqlitelib


Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/ext/gem_make.out

Peter Hicks

unread,
Jan 3, 2012, 4:57:20 AM1/3/12
to rubyonra...@googlegroups.com
On Tue, Jan 03, 2012 at 01:52:10AM -0800, Libber wrote:

> I am trying to install ruby on rails...but the sqlite3-ruby part
> has been the trouble giver. I read almost every trouble shoot given in
> various forums in internet but nothing worked?

What did you try? Have you also tried installing the sqlite3 header files?


Peter

Colin Law

unread,
Jan 3, 2012, 5:06:03 AM1/3/12
to rubyonra...@googlegroups.com
On 3 January 2012 09:52, Libber <amarnath...@gmail.com> wrote:
> Dear all,
>         I am trying to install ruby on rails...but the sqlite3-ruby part has
> been the trouble giver. I read almost every trouble shoot given in various
> forums in internet but nothing worked?

Which operating system are you using and which version of rails?

Colin

Libber

unread,
Jan 3, 2012, 5:16:49 AM1/3/12
to rubyonra...@googlegroups.com
I am using ubuntu 10.04. 
$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]

$rails -v
Rails 2.2.3

These are the additional header files I installed already 
$ sudo apt-get install libsqlite3-0 libsqlite3-dev

I am behind a bad proxy, so i downloaded all gem files and installed locally. This sqlite-ruby-2.2.3.gem also, I downloaded and am trying to install locally.

Thanks,



Colin Law

unread,
Jan 3, 2012, 5:49:46 AM1/3/12
to rubyonra...@googlegroups.com

I don't know whether it may be the problem but have you also installed sqlite3?
sudo apt-get install sqlite3

Otherwise you could use apt-file search to find which package should
supply sqlite.h

Colin

Libber

unread,
Jan 3, 2012, 5:54:17 AM1/3/12
to rubyonra...@googlegroups.com
I already have it. 
$ sudo apt-get install sqlite3 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
sqlite3 is already the newest version.

>>Otherwise you could use apt-file search to find which package should
supply sqlite.h

How do I do this? ( I am newbie to ubuntu...please bare with me)

Peter Vandenabeele

unread,
Jan 3, 2012, 6:08:49 AM1/3/12
to rubyonra...@googlegroups.com

Strange ...

On my system (Ubuntu 11.10 here), everything points to sqlite3 (THREE that is) .

So, I get  sqlite3.h  (THREE) from here:

~/b$ dpkg -L libsqlite3-dev
/.
/usr
/usr/include
/usr/include/sqlite3.h
/usr/include/sqlite3ext.h

But, the OP seems to require sqlite.h  (without 3)

> checking for sqlite.h... no

and that is indeed found in a different package:


$ apt-file search sqlite.h
...
libsqlite0-dev: /usr/include/sqlite.

that was not mentioned in the apt-get install list of the OP.

So, why is the OP trying to install a version of sqlite that
seems to be older than sqlite3 ??

@Libber could you please post the Gemfile and Gemfile.lock (if available)
from the root directory of your Rails project.

Why are you caring for the 'sqlite-ruby' gem ? Why not simply

  gem 'sqlite3'

in your Gemfile that seems to bring little trouble to users on Ubuntu 10.04
(I have used it there for many cases and never had trouble with it).

Hope This Helps (not entirely sure, actually ...)

Peter

--
Peter Vandenabeele
http://twitter.com/peter_v

Libber

unread,
Jan 3, 2012, 6:29:02 AM1/3/12
to rubyonra...@googlegroups.com, pe...@vandenabeele.com
@ Peter,
       In my rails project directory, where should I search for gemfile, gemfile.lock? can you explain ?

while Installing RoR,  I have to sqlite3, and then link this to RoR using sqlite3-ruby. So, The first step is fine...second gives me this error!. 

Is there any way I can use some other database software other than sqlite3 and get rid of the error( and hope to get no more errors)

Colin Law

unread,
Jan 3, 2012, 6:32:05 AM1/3/12
to rubyonra...@googlegroups.com
On 3 January 2012 09:52, Libber <amarnath...@gmail.com> wrote:
> Dear all,
>         I am trying to install ruby on rails...but the sqlite3-ruby part has
> been the trouble giver. I read almost every trouble shoot given in various
> forums in internet but nothing worked?
>
> I am attaching the output of the command here too. Please help me.
>
> sudo gem install sqlite-ruby-2.2.3.gem

I think the problem may be that you are trying to install sqlite-ruby
instead of sqlite3-ruby

Colin

Peter Vandenabeele

unread,
Jan 3, 2012, 6:42:48 AM1/3/12
to rubyonra...@googlegroups.com
On Tue, Jan 3, 2012 at 12:29 PM, Libber <amarnath...@gmail.com> wrote:
@ Peter,
       In my rails project directory, where should I search for gemfile, gemfile.lock? can you explain ?

Sorry, I had not seen you are using the older Rails version 2.2.3  .... There is no Gemfile and Gemfile.lock
there by default.


while Installing RoR,  I have to sqlite3, and then link this to RoR using sqlite3-ruby. So, The first step is fine...second gives me this error!. 

Is there any way I can use some other database software other than sqlite3 and get rid of the error( and hope to get no more errors)

You could use 

  gem 'mysql2', '~>0.3.10' # Ubuntu : libmysql-ruby1.9.1 libmysqlclient-dev
  gem 'pg' # Ubuntu : libpq-dev

but those will have other set-up issue that you need to handle.

Peter

--

Libber

unread,
Jan 3, 2012, 7:08:39 AM1/3/12
to rubyonra...@googlegroups.com
@collin:
           Wonderful, I was literally crying for the past 20 days in trying to install this sqlite3-ruby. The whole mistake is I should have used "sqlite3-ruby" instead of "sqlite-ruby".  Thank you very much. 

Thanks a lot once again....

It is working ...yureka...:)

Colin Law

unread,
Jan 3, 2012, 7:14:46 AM1/3/12
to rubyonra...@googlegroups.com
On 3 January 2012 12:08, Libber <amarnath...@gmail.com> wrote:
> @collin:
>            Wonderful, I was literally crying for the past 20 days in trying
> to install this sqlite3-ruby. The whole mistake is I should have used
> "sqlite3-ruby" instead of "sqlite-ruby".  Thank you very much.

Thanks should go to Peter Vandenabeele also, it was his pointing out
that sqlite.h should not be used by sqlite3 that made me notice your
error.

Colin

Libber

unread,
Jan 3, 2012, 7:26:21 AM1/3/12
to rubyonra...@googlegroups.com
Sorry for that....

A special thanks to Peter Vandenabeele also.

"Long live open source communities "

Peter Vandenabeele

unread,
Jan 3, 2012, 7:41:21 AM1/3/12
to rubyonra...@googlegroups.com
On Tue, Jan 3, 2012 at 1:26 PM, Libber <amarnath...@gmail.com> wrote:
Sorry for that....

No prob, you're welcome :-)

Still, is this a new application you are starting (since you are
now setting up the first database connection)?

Why not use the easy default Rails 3 set-up. Setting it up on
Ubuntu 10.xy, 11.xy is a breeze [0].

You will have more trouble getting support on this list for
a 2.2.x application than a 3.x application. Also, I a doubt
if security updates are still supported for 2.2.x Rails apps ...

HTH,

Peter

[0] one of the many tutorials for Ruby on Linux (I wrote it)
http://rails.vandenabeele.com/blog/2011/11/26/installing-ruby-and-rails-with-rvm-on-ubuntu-11-dot-10/


Libber

unread,
Jan 3, 2012, 8:13:22 AM1/3/12
to rubyonra...@googlegroups.com, pe...@vandenabeele.com
For some reason, curl does not work when we are behind a proxy. I actually started my project with the same link you gave. After two days without result, I switched to the present way...

Peter Vandenabeele

unread,
Jan 3, 2012, 9:12:07 AM1/3/12
to rubyonra...@googlegroups.com
On Tue, Jan 3, 2012 at 2:13 PM, Libber <amarnath...@gmail.com> wrote:
For some reason, curl does not work when we are behind a proxy.

Do you mean the curl to download rvm ?

I assume you know that there are ways on Linux to set proxy settings system wide
(I don't know much detail, but that problem should be possible to resolve).

Specifically for rvm, this page could be relevant:

http://beginrescueend.com/workflow/proxy/
"Installing RVM behind a proxy"
 
I actually started my project with the same link you gave. After two days without result, I switched to the present way...

Maybe I misunderstood your problem. Could you explain a little more detail please.
If needed, I can improve the text to discuss this problem and the solution.

And ... even without rvm, why not use Rails 3.1 ? Why is the proxy not a problem
for Rails 2.2.x and it is a problem for Rails 3.1?

Sorry for all the questions, but I am curious what is the real problem.

Peter

Libber

unread,
Jan 3, 2012, 9:42:47 AM1/3/12
to rubyonra...@googlegroups.com
@Peter,
           Thanks for those links. The whole problem with proxy was that my password contains special characters(it is must to have atleast one special character), Now I figured out a way to change the password and without a special character. This worked and in the next computer I am running rvm with ease...... and rails >3.x.... 

Thanks 
Reply all
Reply to author
Forward
0 new messages