Rails 3 will not install sqlite3-ruby gem with rvm?

I'm trying to start rvm and install ruby โ€‹โ€‹1.9.2 and rails 3 with it. I need to reinstall the sqlite3-ruby stone (since rvm stores all the gems separately for different versions of ruby).

The problem is that when I try, I get:

gem install sqlite3-ruby /home/jenny/.rvm/rubies/ruby-1.9.2-p0/bin/gem:4: warning: Insecure world writable dir /home/jenny/.rvm/gems/ruby-1.9.2-p0/bin in PATH, mode 040777 Building native extensions. This could take a while... ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /home/jenny/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb checking for sqlite3.h... yes checking for sqlite3_libversion_number() in -lsqlite3... yes checking for rb_proc_arity()... yes checking for sqlite3_initialize()... yes checking for sqlite3_next_stmt()... yes checking for sqlite3_column_database_name()... yes checking for sqlite3_enable_load_extension()... no checking for sqlite3_load_extension()... no creating Makefile make gcc -I. -I/home/jenny/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/i686-linux -I/home/jenny/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1/ruby/backward -I/home/jenny/.rvm/rubies/ruby-1.9.2-p0/include/ruby-1.9.1 -I. -DHAVE_RB_PROC_ARITY -DHAVE_SQLITE3_INITIALIZE -DHAVE_SQLITE3_NEXT_STMT -DHAVE_SQLITE3_COLUMN_DATABASE_NAME -I/usr/local/include -I/opt/local/include -I/sw/local/include -I/usr/include -D_FILE_OFFSET_BITS=64 -fPIC -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -fPIC -o exception.o -c exception.c In file included from ./sqlite3_ruby.h:42, from exception.c:1: ./backup.h:7: error: expected specifier-qualifier-list before 'sqlite3_backup' make: *** [exception.o] Error 1 

I'm really not quite sure what to do with this ... I already used sqlite3-ruby on this machine (with rails 2.3.5). When I try to reinstall this stone (using the rvm system settings), it doesn't install the ruby โ€‹โ€‹1.8.7 enviornment, EITHER.

Did rvm destroy the gem? Is the new gem just incompatible with my OS (I am running opensuse linux)

Edit: when I try to reinstall (remove than install again) sqlite3-ruby in my normal ruby โ€‹โ€‹environment, I get the same error, but then I see sqlite3-ruby listed in my gems list (not sure if it then restores from backup or installation, despite the error)

+6
ruby rvm sqlite3-ruby
source share
4 answers

You can try

 gem install sqlite3-ruby -- --with-sqlite3-dir=/path/to/your/sqlite3 

And if this does not work, you can try updating your sqlite3 , 3.6.4 is quite old, and I think the new Ruby sqlite versions have problems with something old.

(And the most likely reason you get different answers with these two is because there was a major change between versions 2 and 3 - mostly with Unicode, I believe - and some programs still use 2, and not 3.)

+4
source share

I will vote or comment on Brennanโ€™s answer, but I donโ€™t have enough points yet. I decided that I would leave this answer if it helps someone else: I spent some time on it ... I installed Ruby 1.9.1 and Rails 3.0.3 and worked, but decided to upgrade to RVM. Installed RVM as instructed, and then installed the rails again, all the sauce ... then tried to bind the installation and ran into this error using sqlite3:

 Building native extensions. This could take a while... ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension. /Users/Jasonp/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb 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' 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. 

I know that I used to work on SQLite3 in my previous configuration, so I went looking for the source directory. which was usr / local / sqlite3

I tried to use this as the path --with-sqlite3-dir= , but did not work. Then just for fun, I tried:

 gem install sqlite3-ruby -- --with-sqlite3-dir=/usr/local/lib 

and for the reason wahtever, it worked. So just in case someone

+6
source share

When I installed sqlite3 from the source, it put the included files in / usr / local / include

I tried

 gem install sqlite3-ruby -- --with-sqlite3-dir=/usr/local/lib 

and he is finally installed.

+3
source share

on ubuntu 9.04 I also had to download sqlite and install from source

0
source share

All Articles