How can install sqlite-ruby on linux when sqlite3 is not in /usr/local?
I am trying to install sqlite3 and sqlite-ruby (ruby 1.8.6) on a linux box where I do not have root.
I downloaded the sqlite3 source, binaries, and shared library and placed them all in a directory called sqlite3
I then try to install sqlite-ruby using
gem install sqlite-ruby --with-sqlite-dir=the_path_sqlite/sqlite3
but I keep getting the error...
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开发者_如何学JAVA
--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=/data/scratch/bettbra/common/packages/ruby-1.8.6/bin/ruby
--with-sqlite-dir
--with-sqlite-include
--without-sqlite-include=${sqlite-dir}/include
--with-sqlite-lib
--without-sqlite-lib=${sqlite-dir}/lib
--with-sqlitelib
--without-sqlitelib
You specify where the development files (headers & lib) are using the following syntax:
gem install sqlite3 -- --with-sqlite3-include=$HOME/include --with-sqlite3-lib=$HOME/lib
Notice the -- that mark the end of gem
options. After them, the options are passed to the extension compiling process.
However, I second Reuben's advice; you should really consider using RVM. It is a blessing for this kind of situations AND to smooth your migration to Ruby 1.9.
i'm using ubuntu (debain type linux). i managed to resolve it the following way:
sudo apt-get install sqlite3 libsqlite3-dev sudo gem install sqlite3-ruby
Can you install RVM (Ruby Version Manager) ?
https://rvm.io/rvm/install/
With RVM you install gems etc. as a user without sudo/root privileges.
精彩评论