Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby User Authentication with Rails Password Hashing and Sign In Creating the User Model: Part 1

Philippe van der Haert
Philippe van der Haert
26,258 Points

An error occured while installing sqlite (1.3.8) but I have sqlite (3.8.8.2) installed can't I use this version

I downloaded the ODOT project files to follow the tutorial on authentication in Rails. When I try bundle install I get the following error in the terminal

An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue. When I try gem install sqlite3 -v '1.3.8' I get the same error.

After sqlite3 -version I get version 3.8.8.2 can't I change the gemfile in my project tu use this version or find a way to install version 1.3.8 without any errors

Bellow the full error message in the terminal

ERROR: Error installing sqlite3: ERROR: Failed to build gem native extension.

/home/philippevdh/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150212-26043-1nvxw0f.rb 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_backup_init()... yes checking for sqlite3_column_database_name()... yes checking for sqlite3_enable_load_extension()... yes checking for sqlite3_load_extension()... yes checking for sqlite3_open_v2()... yes checking for sqlite3_prepare_v2()... yes checking for sqlite3_int64 in sqlite3.h... yes checking for sqlite3_uint64 in sqlite3.h... yes creating Makefile

make "DESTDIR=" clean

make "DESTDIR=" compiling exception.c compiling sqlite3.c compiling database.c compiling backup.c compiling statement.c statement.c: In function ‘bind_param’: statement.c:261:7: warning: implicit declaration of function ‘RBIGNUM’ [-Wimplicit-function-declaration] if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) { ^ In file included from statement.c:1:0: ./sqlite3_ruby.h:16:34: error: invalid type argument of ‘->’ (have ‘int’) #define RBIGNUM_LEN(x) RBIGNUM(x)->len ^ statement.c:261:11: note: in expansion of macro ‘RBIGNUM_LEN’ if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) { ^ statement.c:261:32: error: ‘SIZEOF_BDIGITS’ undeclared (first use in this function) if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) { ^ statement.c:261:32: note: each undeclared identifier is reported only once for each function it appears in statement.c: In function ‘reset_bang’: statement.c:293:7: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] int status; ^ statement.c: In function ‘clear_bindings’: statement.c:313:7: warning: variable ‘status’ set but not used [-Wunused-but-set-variable] int status; ^ make: *** [statement.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/philippevdh/.rvm/gems/ruby-2.2.0/gems/sqlite3-1.3.8 for inspection. Results logged to /home/philippevdh/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/sqlite3-1.3.8/gem_make.out

3 Answers

Aya Yousef
Aya Yousef
9,658 Points

Update your slite3 from terminal

$ bundle update sqlite3

and it will work :D

http://stackoverflow.com/questions/34151296/cannot-install-sqlite3-gem

I had a similar problem that was fixed by changing gem file to look for the most current version of "sqlite3 gem".

You do this by adding the '>=' in front of the version. For example: gem 'sqlite3', '~> 1.3', '>= 1.3.11'

or you can always go to rubygems.org, search for the sqlite3 gem, and it will give you the current gem name to use in your gemfile.

Brandon Barrette
Brandon Barrette
20,485 Points

Try "gem update sqlite3" in your terminal? Looking at ruby gems 1.3.10 is available:

https://rubygems.org/gems/sqlite3