This forum is no longer active. Please post your questions to our new community site

Error installing sqlite3-ruby

Subscribe to Error installing sqlite3-ruby 8 post(s), 3 voice(s)

 
Avatar ramyayella 11 post(s)

I tried to install sqlite3-ruby in mu bitnami rubystack. It gives me the following error.

My rubystack is in folder /home/ramya/bloglearn/deployment
bash-4.1$ gem install sqlite3-ruby
Building native extensions. This could take a while…
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.

/home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/bin/ruby extconf.rb
checking for sqlite3.h… no
sqlite3.h is missing. Try ‘port install sqlite3 +universal’ or ‘yum install sqlite3-devel’

  • 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=/home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/bin/ruby
—with-sqlite3-dir
—without-sqlite3-dir
—with-sqlite3-include
—without-sqlite3-include=${sqlite3-dir}/include
—with-sqlite3-lib
—without-sqlite3-lib=${sqlite3-dir}/lib

Gem files will remain installed in /home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1 for inspection.
Results logged to /home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out

bash-4.1$ gem install sqlite3-ruby
Building native extensions. This could take a while…
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.

/home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/bin/ruby extconf.rb
checking for sqlite3.h… no
sqlite3.h is missing. Try ‘port install sqlite3 +universal’ or ‘yum install sqlite3-devel’

  • 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=/home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/bin/ruby
—with-sqlite3-dir
—without-sqlite3-dir
—with-sqlite3-include
—without-sqlite3-include=${sqlite3-dir}/include
—with-sqlite3-lib
—without-sqlite3-lib=${sqlite3-dir}/lib

Gem files will remain installed in /home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1 for inspection.
Results logged to /home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.1/ext/sqlite3/gem_make.out

How to resove this error?

 
Avatar carlos Administrator 144 post(s)

Hi,

RubyStack 2.1-0 already includes version 1.2.5 of sqlite3-ruby gem.

In case you need to install a different version, you should specify where sqlite3 files are located:

gem install sqlite3-ruby -- --with-sqlite3-dir=/home/ramya/bloglearn/deployment/rubystack-2.1-0/sqlite

I hope it helps

 
Avatar ramyayella 11 post(s)

I tried to install like this……. so it is giving me the following error.

bash-4.1$ gem install sqlite3-ruby — —with-sqlite3-dir=/home/ramya/bloglearn/deployment/rubystack/sqlite
Building native extensions. This could take a while…
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.

/home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/bin/ruby extconf.rb —with-sqlite3-dir=/home/ramya/bloglearn/deployment/rubystack/sqlite -E
checking for sqlite3.h… yes
checking for sqlite3_libversion_number() in -lsqlite3… yes
checking for rb_proc_arity()… no
checking for sqlite3_initialize()… no
sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!

  • 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.

I think…. i need to upgrade it. How to do that? if not to upgrade how this problem will be solved

 
Avatar carlos Administrator 144 post(s)

Do you require latest gem version (1.3.1) ?

If it fits your needs, I would recommend using the previous one (1.3.0) which supports the sqlite version included in rubystack 2.1:

$ gem install sqlite3-ruby --version 1.3.0 -- --with-sqlite3-dir=/home/ramya/bloglearn/deployment/rubystack-2.1-0/sqlite

Otherwise you may try to download and compile sqlite manually before installing the gem:

$ mkdir /home/ramya/bloglearn/deployment/rubystack-2.1-0/tmp 
$ cd /home/ramya/bloglearn/deployment/rubystack-2.1-0/tmp
$ wget http://www.sqlite.org/sqlite-amalgamation-3.7.0...
$ tar zxf sqlite-amalgamation-3.7.0.1.tar.gz
$ cd sqlite-3.7.0.1/
$ CFLAGS="-L/home/ramya/bloglearn/deployment/rubystack-2.1-0/common/lib -I/home/ramya/bloglearn/deployment/rubystack-2.1-0/common/include" ./configure --prefix=/home/ramya/bloglearn/deployment/rubystack-2.1-0/sqlite-3.7.0.1 --enable-static=no
$ make 
$ make install 
$ cd ../../
$ mv sqlite sqlite-3.5.1
$ ln -s /home/ramya/bloglearn/deployment/rubystack-2.1-0/sqlite-3.7.0.1 /home/ramya/bloglearn/deployment/rubystack-2.1-0/sqlite
$ /home/ramya/bloglearn/deployment/rubystack-2.1-0/gem install sqlite3-ruby -- --with-sqlite3-dir=/home/ramya/bloglearn/deployment/rubystack-2.1-0/sqlite

Let us know if you find any issues

 
Avatar ramyayella 11 post(s)

I have installed the sqlite3-ruby like above.

then when i run the project it gives these errors
home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/bin/.ruby.bin: symbol lookup error: /home/ramya/bloglearn/deployment/rubystack-2.1-0/ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.3.0/lib/sqlite3/sqlite3_native.so: undefined symbol: sqlite3_initialize

why is this type of error coming?
what to do now?

 
Avatar danoo Administrator 81 post(s)

Hi,

It seems people have similar problems with sqlite3-ruby 1.3.0. I was able to reproduce this issue and probably sqlite-ruby 1.3.0 does not work well with sqlite 3.5.1 bundled with RubyStack by default. Can you please try to follow the steps above compiling sqlite 3.7.0.1 ?

Danoo

 
Avatar ramyayella 11 post(s)

I tried to install using the above steps, but the gem is not installed in the system. It still gives me the error

Building native extensions. This could take a while…
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.

/home/karthik/Desktop/bloglearn/deployment/rubystack-2.1-0/ruby/bin/ruby extconf.rb —with-sqlite3-dir=/home/karthik/Desktop/bloglearn/deployment/rubystack-2.1-0/sqlite/ -E
checking for sqlite3.h… yes
checking for sqlite3_libversion_number() in -lsqlite3… no
sqlite3 is missing. Try ‘port install sqlite3 +universal’ or ‘yum install sqlite3-devel’

  • 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.

Actually earlier i tried on i386 32 bit machine, it is working successfully.
Now i am trying on amd64 machine and i am unable to install the sqlite3-ruby gem in it. I also have ia32-libs installed in the system…….. but this doesn’t work

 
Avatar danoo Administrator 81 post(s)

Hi,

on amd64 machine try to change the previous instructions from:

$ cd sqlite-3.7.0.1/
$ CFLAGS=“-L/home/ramya/bloglearn/deployment/rubystack-2.1-0/common/lib -I/home/ramya/bloglearn/deployment/rubystack-2.1-0/common/include” ./configure —prefix=/home/ramya/bloglearn/deployment/rubystack-2.1-0/sqlite-3.7.0.1 —enable-static=no
$ make

to

$ cd sqlite-3.7.0.1/
$ export CFLAGS=“-m32 -L/home/ramya/bloglearn/deployment/rubystack-2.1-0/common/lib -I/home/ramya/bloglearn/deployment/rubystack-2.1-0/common/include”
$ ./configure —prefix=/home/ramya/bloglearn/deployment/rubystack-2.1-0/sqlite-3.7.0.1 —enable-static=no
$ make

If it does not help, you could try to add also:

$ export CXXFLAGS=-m32
$ export LDFLAGS=-m32
$ export CONFIGURE_ARGS=“—with-cflags=‘-m32’ —with-ldflags=‘-m32’”

Please let me know if it helps.
Danoo