Error with SQLite3 gem

116 views
Skip to first unread message

mark lane

unread,
Jul 19, 2017, 3:11:06 PM7/19/17
to Cucumber and Cheese
Hi 

I have cloned the site from Git and then ran bundle install in the puppy application root. I get an SQLite error below. It won't let me install 

 install

Fetching gem metadata from http://rubygems.org/............

Fetching version metadata from http://rubygems.org/...

Fetching dependency metadata from http://rubygems.org/..

Resolving dependencies...

Using rake 10.0.3

Using i18n 0.6.1

Using multi_json 1.5.0

Using builder 3.0.4

Using erubis 2.7.0

Using journey 1.0.4

Using rack 1.4.3

Using hike 1.2.1

Using tilt 1.3.3

Using mime-types 1.19

Using polyglot 0.3.3

Using arel 3.0.2

Using tzinfo 0.3.35

Using bundler 1.15.0

Using json 1.8.6

Using thor 0.16.0

Using json_pure 1.7.6

Using spruz 0.2.13

Using ffi 1.3.0

Fetching sqlite3 1.3.7

Installing sqlite3 1.3.7 with native extensions

Using will_paginate 3.0.3

Using sass 3.2.5

Using coffee-script-source 1.4.0

Using rspec-core 2.12.2

Using diff-lcs 1.1.3

Using rspec-mocks 2.12.1

Fetching pg 0.14.1

Installing pg 0.14.1 with native extensions

Using addressable 2.3.2

Using websocket 1.0.6

Using rubyzip 0.9.9

Using activesupport 3.2.11

Using execjs 1.4.0

Using rack-cache 1.2

Using rack-test 0.6.2

Using rack-ssl 1.3.2

Using sprockets 2.2.2

Using treetop 1.4.12

Using rdoc 3.12

Using gherkin 2.11.5

Using childprocess 0.3.6

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.


current directory:

/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/sqlite3-1.3.7/ext/sqlite3

/Users/marklane/.rbenv/versions/2.4.0/bin/ruby -r

./siteconf20170719-56249-1vh8qp7.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()... no

checking for sqlite3_enable_load_extension()... no

checking for sqlite3_load_extension()... no

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


current directory:

/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/sqlite3-1.3.7/ext/sqlite3

make "DESTDIR=" clean


current directory:

/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/sqlite3-1.3.7/ext/sqlite3

make "DESTDIR="

compiling backup.c

compiling database.c

database.c:205:3: warning: 'sqlite3_trace' is deprecated

[-Wdeprecated-declarations]

  sqlite3_trace(ctx->db, NIL_P(block) ? NULL : tracefunc, (void *)self);

  ^

/usr/include/sqlite3.h:2850:36: note: 'sqlite3_trace' has been explicitly marked

deprecated here

SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*,

                                   ^

1 warning generated.

compiling exception.c

compiling sqlite3.c

compiling statement.c

statement.c:260:11: warning: implicit declaration of function 'RBIGNUM' is

invalid in C99 [-Wimplicit-function-declaration]

      if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {

          ^

./sqlite3_ruby.h:16:24: note: expanded from macro 'RBIGNUM_LEN'

#define RBIGNUM_LEN(x) RBIGNUM(x)->len

                       ^

statement.c:260:11: error: member reference type 'int' is not a pointer

      if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {

          ^~~~~~~~~~~~~~~~~~

./sqlite3_ruby.h:16:36: note: expanded from macro 'RBIGNUM_LEN'

#define RBIGNUM_LEN(x) RBIGNUM(x)->len

                       ~~~~~~~~~~  ^

statement.c:260:32: error: use of undeclared identifier 'SIZEOF_BDIGITS'

      if (RBIGNUM_LEN(value) * SIZEOF_BDIGITS <= 8) {

                               ^

1 warning and 2 errors generated.

make: *** [statement.o] Error 1


make failed, exit code 2


Gem files will remain installed in

/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/sqlite3-1.3.7 for

inspection.

Results logged to

/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/sqlite3-1.3.7/gem_make.out


An error occurred while installing sqlite3 (1.3.7), and Bundler cannot

continue.

Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.


In Gemfile:

  sqlite3-ruby was resolved to 1.3.3, which depends on

    sqlite3

mark lane

unread,
Jul 19, 2017, 3:12:09 PM7/19/17
to Cucumber and Cheese
any help would be greatly appreciated for thuis newbie

Sean Poulter

unread,
Jul 20, 2017, 12:59:55 PM7/20/17
to Cucumber and Cheese
I didn't reproduce your problem but I had a look at the existing bugs for the sqlite3-ruby gem and found a likely culprit.

When I'm having a problem with a gem, I often see if it's a known issue. You could probably just search for "sqlite3-ruby gem issues", but I normally start chasing down the gem homepage by searching on rubygems.org. That leads us to the homepage on GitHub. From there, searching the issues for "use of undeclared identifier 'SIZEOF_BDIGITS'" gives two issues, both of which might be applicable: either there are side-by-side Rubies (versions of Ruby) installed with renv without a required configuration, or there was an incompatibility problem with an older version of sqlite3-ruby.

Have a look at those and let us know what worked. It's probably worth noting in a repo issue for the puppies project or submitting a pull request if you're really keen.

mark lane

unread,
Jul 21, 2017, 1:56:34 PM7/21/17
to Cucumber and Cheese
Thanks so much for your reply. One of the answers advised updating the sqlite version to .10 but now i get this

current directory:
/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/pg-0.14.1/ext
/Users/marklane/.rbenv/versions/2.4.0/bin/ruby -r
./siteconf20170721-76431-11fqrt7.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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=/Users/marklane/.rbenv/versions/2.4.0/bin/$(RUBY_BASE_NAME)
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config

To see why this extension failed to compile, please check the mkmf.log which can
be found here:

/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/pg-0.14.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/pg-0.14.1 for
inspection.
Results logged to
/Users/marklane/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/pg-0.14.1/gem_make.out

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

In Gemfile:
  pg

Process finished with exit code 5


On Wednesday, July 19, 2017 at 8:11:06 PM UTC+1, mark lane wrote:

mark lane

unread,
Jul 21, 2017, 3:21:35 PM7/21/17
to Cucumber and Cheese
ok i've progressed. got it installed and then run rails s . Loaded local host 300 but get this

We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.


Started GET "/" for 127.0.0.1 at 2017-07-21 20:17:56 +0100

Connecting to database specified by database.yml

Processing by AgencyController#index as HTML

  Rendered agency/index.html.erb within layouts/application (3.5ms)

Completed 500 Internal Server Error in 11ms


On Wednesday, July 19, 2017 at 8:11:06 PM UTC+1, mark lane wrote:

mark lane

unread,
Jul 21, 2017, 3:26:26 PM7/21/17
to Cucumber and Cheese
Thanks so much for your help so far. I got it installed and ran Rails S. I then loaded localhost:3000 but get this:

We're sorry, but something went wrong.

We've been notified about this issue and we'll take a look at it shortly.


Terminal:

Started GET "/" for 127.0.0.1 at 2017-07-21 20:17:56 +0100

Connecting to database specified by database.yml

Processing by AgencyController#index as HTML

  Rendered agency/index.html.erb within layouts/application (3.5ms)

Completed 500 Internal Server Error in 11ms


Reply all
Reply to author
Forward
0 new messages