Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting the rails, sqlite3 Error

I start checking that the versions are appropriate, after checking that my system meets the minimum requirements: rails new app When zero the new application I get the message NEXT:

         run  bundle install
/var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/ui.rb:36:in `initialize': undefined method `[]' for #<Thor::Shell::Color:0x95890e0> (NoMethodError)
    from /usr/lib/ruby/vendor_ruby/bundler/cli.rb:12:in `new'
    from /usr/lib/ruby/vendor_ruby/bundler/cli.rb:12:in `initialize'
    from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor.rb:263:in `new'
    from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor.rb:263:in `dispatch'
    from /usr/lib/ruby/vendor_ruby/bundler/vendor/thor/base.rb:386:in `start'
    from /var/lib/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:20:in `block in <main>'
    from /var/lib/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/friendly_errors.rb:3:in `with_friendly_errors'
    from /var/lib/gems/1.9.1/gems/bundler-1.3.5/bin/bundle:20:in `<main>'

entered the newly created Rails application. I run bundle install thereupon start to install and get the following error message:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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/bin/ruby1.9.1
    --with-sqlite3-dir
    --without-sqlite3-dir
    --with-sqlite3-include
    --without-sqlite3-include=${sqlite3-dir}/include
    --with-sqlite3-lib
    --without-sqlite3-lib=${sqlite3-dir}/lib
    --enable-local
    --disable-local


Gem files will remain installed in /home/helio/.bundler/tmp/23089/gems/sqlite3-1.3.8 for inspection.
Results logged to /home/helio/.bundler/tmp/23089/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out

An error occurred while installing sqlite3 (1.3.8), and Bundler
cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before
bundling.

I've tried but I get an error message when I try to install splite3:

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

        /usr/bin/ruby1.9.1 extconf.rb
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** 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/bin/ruby1.9.1
    --with-sqlite3-dir
    --without-sqlite3-dir
    --with-sqlite3-include
    --without-sqlite3-include=${sqlite3-dir}/include
    --with-sqlite3-lib
    --without-sqlite3-lib=${sqlite3-dir}/lib
    --enable-local
    --disable-local


Gem files will remain installed in /var/lib/gems/1.9.1/gems/sqlite3-1.3.8 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
like image 301
Hell0 Avatar asked Mar 11 '26 18:03

Hell0


1 Answers

I had the same error, trying to start a new Rails project. In this case sqlite3.h is missing, means that libsqlite3-dev is missing, I guess (I'm new with Ubuntu and Sqlite3). The answer can be found right here : Installing sqlite headers.

~$ sudo apt-get install sqlite3
~$ sudo apt-get install libsqlite3-dev
~$ bundle install

After that, rails server worked well for me. I had my Welcome aboard in localhost.

like image 64
Eric Lavoie Avatar answered Mar 13 '26 07:03

Eric Lavoie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!