In the setup phase of an app that generates random quotes every few minutes. (Could probably use a motivation quote myself right about now as I've been pulling my hair out on this one for a day!)
Using ruby 2.3.0p0, and upon running bundle install, I get the following error:
bundle install
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Resolving dependencies...
Using rake 10.1.1
Using i18n 0.6.9
Using minitest 4.7.5
Using multi_json 1.8.2
Using atomic 1.1.14
Using tzinfo 0.3.38
Using builder 3.1.4
Using erubis 2.7.0
Using rack 1.5.2
Using mime-types 1.25.1
Using polyglot 0.3.3
Using activerecord-deprecated_finders 1.0.3
Using arel 4.0.1
Using bundler 1.12.5
Using chronic 0.10.2
Using coffee-script-source 1.6.3
Using execjs 2.0.2
Using thor 0.18.1
Using flickraw 0.9.7
Using hike 1.2.3
Installing json 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/json-1.8.1/ext/json/ext/generator
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160803-40268-tnpkzj.rb extconf.rb --use-system-libraries
creating Makefile
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’:
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [enabled by default]
VALUE result = rb_str_new(FBUFFER_PAIR(fb));
^
make: *** [generator.o] Error 1
make failed, exit code 2
Gem files will remain installed in /usr/local/rvm/gems/ruby-2.3.0/gems/json-1.8.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/json-1.8.1/gem_make.out
Using pg 0.17.1
Using tilt 1.4.1
Using rails_serve_static_assets 0.0.2
Using rails_stdout_logging 0.0.3
Using sass 3.2.13
Installing sqlite3 1.3.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/sqlite3-1.3.8/ext/sqlite3
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160803-40268-16a4yjy.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
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.8/mkmf.log
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/sqlite3-1.3.8/ext/sqlite3
make "DESTDIR=" clean
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/sqlite3-1.3.8/ext/sqlite3
make "DESTDIR="
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 /usr/local/rvm/gems/ruby-2.3.0/gems/sqlite3-1.3.8 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.8/gem_make.out
Using will_paginate 3.0.5
Using thread_safe 0.1.3
Using rack-test 0.6.2
Using treetop 1.4.15
Using coffee-script 2.2.0
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
I've taken some advice after research on similar issues from others and tried updating json by using 'bundle update json' and am still getting the same issue.
Here is the gemfile:
source 'https://rubygems.org'
#ruby "2.1.0"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.2'
# Use sqlite3 as the database for Active Record
group :development do
gem 'sqlite3'
end
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 3.0.4'
#Gem for Heroku and PostgreSQL
group :production, :staging do
gem 'rails_12factor'
gem 'pg'
end
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
# Used for Flickr
gem 'flickraw'
#Used for writing and deploying cron jobs
gem 'whenever', :require => false
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
#Use will-paginate for pagination
gem 'will_paginate', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.1.2'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
This idea is originally from the following github project (https://github.com/Lieke22/Quotes.git) which I will be modifying to practice creating a rails web app.
I would greatly appreciate any feedback, pointers.
Best,
Brinder
Sounds like you need the tools to build native gems.
Try installing 'ruby-dev' with your package manager.
At First you should try
$ sudo gem install json -v '1.8.1'
In case if that didn't work, you could do this:
$ sudo apt-get install ruby-dev
and then you could install the gem and continue. Hope that can be fixed by:
$ sudo apt-get install libsqlite3-dev
Related
I am trying to run a bundle install, but when I do, I am getting an error message that says, "An error occurred while installing sqlite3 (1.3.13), and Bundler cannot continue." I tried running gem install sqlite3 -v '1.3.13', but am getting an error with that as well.
Here is my Gemfile:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.1'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
end
group :production do
gem 'pg'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'jquery-rails'
gem 'devise'
Here is the error I get when I try to run bundle install:
Kelly#LAPTOP /c/Sites/my_app (master)
$ bundle install
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies..................
Using rake 12.0.0
Using concurrent-ruby 1.0.5 (java)
Using i18n 0.8.4
Using minitest 5.10.2
Using thread_safe 0.3.6 (java)
Using builder 3.2.3
Using erubi 1.6.0
Using nokogiri 1.8.0 (java)
Using rack 2.0.3
Using nio4r 2.1.0 (java)
Using websocket-extensions 0.1.2
Using mime-types-data 3.2016.0521
Using arel 8.0.0
Using bundler 1.15.1
Using method_source 0.8.2
Using thor 0.19.4
Using puma 3.9.1 (java)
Using sass 3.4.24
Using tilt 2.0.7
Using execjs 2.7.0
Using coffee-script-source 1.12.2
Using turbolinks-source 5.0.3
Using multi_json 1.12.1
Fetching sqlite3 1.3.13
Installing sqlite3 1.3.13 with native extensions
C:/jruby-9.1.8.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:56: warning: Tempfile#unlink or delete called on open file; ignoring
Fetching bindex 0.5.0
Installing bindex 0.5.0 with native extensions
C:/jruby-9.1.8.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:56: warning: Tempfile#unlink or delete called on open file; ignoring
Using bcrypt 3.1.11 (java)
Using orm_adapter 0.5.0
Using tzinfo 1.2.3
Using loofah 2.0.3
Using rack-test 0.6.3
Using sprockets 3.7.1
Using warden 1.2.7
Using websocket-driver 0.6.5 (java)
Using mime-types 3.1
Using uglifier 3.2.0
Using coffee-script 2.4.1
Using turbolinks 5.0.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/jruby-9.1.8.0/lib/ruby/gems/shared/gems/sqlite3-1.3.13/ext/sqlite3
C:/jruby-9.1.8.0/bin/jruby.exe -r ./siteconf20170707-17112-s04bux.rb extconf.rb
checking for sqlite3.h... RuntimeError: The compiler failed to generate an
executable file.
You have to install development tools first.
try_do at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:456
try_cpp at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:587
block in find_header at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:1144
block in checking_for at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:942
block in postpone at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:350
open at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:320
block in postpone at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:350
open at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:320
postpone at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:346
checking_for at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:941
find_header at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:1143
<main> at extconf.rb:50
*** 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=C:/jruby-9.1.8.0/bin/jruby
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
C:/jruby-9.1.8.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/sqlite3-1.3.13/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
C:/jruby-9.1.8.0/lib/ruby/gems/shared/gems/sqlite3-1.3.13 for inspection.
Results logged to
C:/jruby-9.1.8.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/sqlite3-1.3.13/gem_make.out
An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
continue.
Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling.
In Gemfile:
sqlite3
Here is the error I get when I try to run gem install sqlite -v '1.3.13':
Kelly#LAPTOP /c/Sites/my_app (master)
$ gem install sqlite3 -v '1.3.13'
Building native extensions. This could take a while...
C:/jruby-9.1.8.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:56: warning: Tempfile#unlink or delete called on open file; ignoring
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
current directory: C:/jruby-9.1.8.0/lib/ruby/gems/shared/gems/sqlite3-1.3.13/ext/sqlite3
C:/jruby-9.1.8.0/bin/jruby.exe -r ./siteconf20170707-17048-ojikan.rb extconf.rb
checking for sqlite3.h... RuntimeError: The compiler failed to generate an executable file.
You have to install development tools first.
try_do at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:456
try_cpp at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:587
block in find_header at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:1144
block in checking_for at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:942
block in postpone at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:350
open at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:320
block in postpone at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:350
open at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:320
postpone at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:346
checking_for at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:941
find_header at C:/jruby-9.1.8.0/lib/ruby/stdlib/mkmf.rb:1143
<main> at extconf.rb:50
*** 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=C:/jruby-9.1.8.0/bin/jruby
--with-sqlite3-config
--without-sqlite3-config
--with-pkg-config
--without-pkg-config
--with-sqlite3-dir
--without-sqlite3-dir
--with-sqlite3-include
--without-sqlite3-include=${sqlite3-dir}/include
--with-sqlite3-lib
--without-sqlite3-lib=${sqlite3-dir}/lib
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/jruby-9.1.8.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/sqlite3-1.3.13/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/jruby-9.1.8.0/lib/ruby/gems/shared/gems/sqlite3-1.3.13 for inspection.
Results logged to C:/jruby-9.1.8.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/sqlite3-1.3.13/gem_make.out
Any help is appreciated as I cannot move forward until I run a successful bundle install and I've tried researching for days and cannot figure out how to fix this.
Updated 7/9/17: Here is my updated Gemfile where I am still not able to run bundle install nor bundle update:
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.1'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
# Use sqlite3 as the database for Active Record
gem 'sqlite3', platform: :ruby
gem 'jdbc-sqlite3', platform: :jruby
gem 'activerecord-jdbc-adapter', platform: :jruby
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
end
group :production do
gem 'pg'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'jquery-rails'
gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3', '>= 1.3.23'
Updated 7/10/17: After removing gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3', '>= 1.3.23', I tried bundle install again and this time, I got a different error:
Kelly#LAPTOP /c/Sites/my_app (master)
$ bundle install
The dependency sqlite3 (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for x86-mingw32, java but the dependency is only for ruby. To add those platforms to the bundle, run `bundle lock --add-platform ruby`.
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies........................
Using rake 12.0.0
Using concurrent-ruby 1.0.5 (java)
Using i18n 0.8.4
Using minitest 5.10.2
Using thread_safe 0.3.6 (java)
Using builder 3.2.3
Using erubi 1.6.0
Using nokogiri 1.8.0 (java)
Using rack 2.0.3
Using nio4r 2.1.0 (java)
Using websocket-extensions 0.1.2
Using mime-types-data 3.2016.0521
Using arel 8.0.0
Using bundler 1.15.1
Using method_source 0.8.2
Using thor 0.19.4
Using puma 3.9.1 (java)
Using sass 3.4.24
Using tilt 2.0.7
Using execjs 2.7.0
Using coffee-script-source 1.12.2
Using turbolinks-source 5.0.3
Using multi_json 1.12.1
Using jdbc-sqlite3 3.15.1
Fetching bindex 0.5.0
Installing bindex 0.5.0 with native extensions
C:/jruby-9.1.8.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:56: warning: Tempfile#unlink or delete called on open file; ignoring
Using tzinfo 1.2.3
Using loofah 2.0.3
Using rack-test 0.6.3
Using sprockets 3.7.1
Using websocket-driver 0.6.5 (java)
Using mime-types 3.1
Using uglifier 3.2.0
Using coffee-script 2.4.1
Using turbolinks 5.0.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/jruby-9.1.8.0/lib/ruby/gems/shared/gems/bindex-0.5.0/ext/bindex
C:/jruby-9.1.8.0/bin/jruby.exe -r ./siteconf20170710-21728-1asiecp.rb extconf.rb
current directory:
C:/jruby-9.1.8.0/lib/ruby/gems/shared/gems/bindex-0.5.0/ext/bindex
make "DESTDIR=" clean
'make' is not recognized as an internal or external command,
operable program or batch file.
current directory:
C:/jruby-9.1.8.0/lib/ruby/gems/shared/gems/bindex-0.5.0/ext/bindex
make "DESTDIR="
'make' is not recognized as an internal or external command,
operable program or batch file.
make failed, exit code 1
Gem files will remain installed in
C:/jruby-9.1.8.0/lib/ruby/gems/shared/gems/bindex-0.5.0 for inspection.
Results logged to
C:/jruby-9.1.8.0/lib/ruby/gems/shared/extensions/universal-java-1.8/2.3.0/bindex-0.5.0/gem_make.out
An error occurred while installing bindex (0.5.0), and Bundler cannot continue.
Make sure that `gem install bindex -v '0.5.0'` succeeds before bundling.
In Gemfile:
web-console was resolved to 3.5.1, which depends on
bindex
There has been a perfect answer. Check out the article "An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue Cannot create rails app" in stackoverflow.
I quote the following solution
It's failing because you are missing a dependency. You can get it by running sudo apt-get install libsqlite3-dev
The gem activerecord-jdbcsqlite3-adapter is not yet compatible with Rails 5. I was able to successfully use JRuby with Rails 4.1.3, from a couple of years ago. The team working on JDBC adapters operates on an open source basis, which general means they work for free, so you get what you get.
You have two choices:
1) Uninstall JRuby and use Rails 5 with an MRI-based interpreter; or
2) Use JRuby with an older version of Rails, like 4.2.9 or lower.
My suggestion is to stick with option 1, since you don't have to do anything special at all -- MRI is the normal Ruby interpreter. You also never explained your reasons for choosing JRuby, which makes me suspect a bit of an XY Problem. If you go with option 2, please review your reasons for selecting JRuby and make sure you know both what you're doing and why you're doing it.
This is a very common problem when running a Rails App.
The answer is at this link: https://github.com/sparklemotion/sqlite3-ruby/issues/224
or this Youtube video: https://www.youtube.com/watch?v=G-B_KUFNkQQ&t=556s
Instructions:
Step 1: Open your Gemfile
Step 2: Find where it says:
gem 'sqlite3'
and change this to:
gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec"
(Run "bundle install" if the server still doesn't run.)
When I run
rails s in the console, command fails and I get this response:
Could not find nokogiri-1.6.8.1 in any of the sources
Run bundle install to install missing gems.
First issue here is that nokogiri is not in my Gemfile because I'm not using nokogiri, so why is nokogiri an issue when it's not even part of the project where I'm running bundle install?
Then I run bundle install according to the initial prompt:
bundle install
I get an error. The final error message:
An error occurred while installing byebug (9.0.6), and Bundler cannot continue.
Make sure that gem install byebug -v '9.0.6' succeeds before bundling.
I noticed that throughout I get other errors that say:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
So, is this a problem with the Gemfile in my project or is it a deeper issue? Meaning the way the Gems are installed in my computer?
This is my Gemfile:
source "https://rubygems.org"
ruby "2.3.0"
gem "paperclip"
# Amazon web services
gem 'aws-sdk', '~> 2'
gem 'rails-erd'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
gem 'materialize-sass'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'hirb'
gem 'jquery-ui-rails'
# Use jquery as the JavaScript library
gem 'jquery-rails', '~> 2.2.2'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'activerecord-reset-pk-sequence'
gem 'acts-as-taggable-on'
gem 'simple_form'
gem 'rails_autolink'
gem 'perfect-scrollbar-rails'
gem 'rails_12factor'
gem 'pundit'
gem 'figaro'
# Use ActiveModel has_secure_password
# Use Unicorn as the app server
# gem 'unicorn'
group :production do
gem 'pg'
gem 'bcrypt'
gem 'whenever', require: false
end
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
#testing
gem 'capybara'
gem 'rspec-rails'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
gem "nifty-generators"
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
gem 'mocha', group: :test
This is the full response I get after running:
bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Using rake 12.0.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.10.1
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 1.6.5
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using activerecord-reset-pk-sequence 0.2.1
Using public_suffix 2.0.4
Using aws-sigv4 1.0.0
Using jmespath 1.3.1
Using bcrypt 3.1.11
Using debug_inspector 0.0.2
Installing byebug 9.0.6 with native extensions
Using choice 0.2.0
Using chronic 0.10.2
Using coffee-script-source 1.12.2
Using execjs 2.7.0
Using thor 0.19.4
Using concurrent-ruby 1.0.2
Using diff-lcs 1.2.5
Using hirb 0.7.3
Using multi_json 1.12.1
Using sass 3.4.22
Using metaclass 0.0.4
Using mimemagic 0.3.2
Using nifty-generators 0.4.6
Installing pg 0.19.0 with native extensions
Using bundler 1.13.6
Using ruby-graphviz 1.2.2
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using rdoc 4.3.0
Using rspec-support 3.5.0
Using tilt 2.0.5
Installing sqlite3 1.3.12 with native extensions
Using turbolinks-source 5.0.0
Using tzinfo 1.2.2
Installing nokogiri 1.6.8.1 with native extensions
Using rack-test 0.6.3
Using mime-types 3.1
Using addressable 2.5.0
Using aws-sdk-core 2.6.38
Using binding_of_caller 0.7.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/byebug-9.0.6/ext/byebug
/usr/local/opt/ruby/bin/ruby -r ./siteconf20161217-12309-210wge.rb extconf.rb
creating Makefile
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/byebug-9.0.6/ext/byebug
make "DESTDIR=" clean
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/byebug-9.0.6/ext/byebug
make "DESTDIR="
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
make failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.3.0/gems/byebug-9.0.6 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-15/2.3.0/byebug-9.0.6/gem_make.out
An error occurred while installing byebug (9.0.6), and Bundler cannot continue.
Make sure that `gem install byebug -v '9.0.6'` succeeds before bundling.
Ok, thank you for updating your question with the bundle output. The problem is that you don't have xcode's command line tools installed.
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/byebug-9.0.6/ext/byebug
make "DESTDIR=" clean
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
current directory: /usr/local/lib/ruby/gems/2.3.0/gems/byebug-9.0.6/ext/byebug
make "DESTDIR="
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at:
/Library/Developer/CommandLineTools/usr/bin/xcrun
make failed, exit code 1
To fix it just run in your command line:
xcode-select --install
This should fix it.
Whenever I try to bundle install on DigitalOcean Droplet - ruby-rails-postgres-nginx-unicorn
I later installed mongodb using SSH from terminal
and later when uploading the project to the /home// folder and bundle install, I get this error.
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
vinod#ruby-rails-postgres-nginx-unicorn-512mb-sgp1-01:~/dride$ bundle
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 11.1.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.0
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.5.2
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using nokogiri 1.6.7.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using loofah 2.0.3
Using rails-html-sanitizer 1.0.3
Using actionview 4.2.5.2
Using rack 1.6.4
Using rack-test 0.6.3
Using actionpack 4.2.5.2
Using globalid 0.3.6
Using activejob 4.2.5.2
Using mime-types-data 3.2016.0521
Using mime-types 3.1
Using mail 2.6.4
Using actionmailer 4.2.5.2
Using activemodel 4.2.5.2
Using arel 6.0.3
Using activerecord 4.2.5.2
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160525-15401-ztxhbh.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling crypt_gensalt.c
compiling crypt.c
compiling crypt_blowfish.c
virtual memory exhausted: Cannot allocate memory
make: *** [crypt_blowfish.o] Error 1
make failed, exit code 2
Gem files will remain installed in /tmp/bundler20160525-15401-11lp2i/bcrypt-3.1.11/gems/bcrypt-3.1.11 for inspection.
Results logged to /tmp/bundler20160525-15401-11lp2i/bcrypt-3.1.11/extensions/x86_64-linux/2.2.0/bcrypt-3.1.11/gem_make.out
An error occurred while installing bcrypt (3.1.11), and Bundler cannot
continue.
Make sure that gem install bcrypt -v '3.1.11' succeeds before bundling.
And my gemfile is
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5.2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'mongoid', '~> 5.1.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem "factory_girl_rails"
gem 'ffaker'
gem "shoulda-matchers"
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :test do
gem "rspec-rails"
end
gem "devise"
UPDATED
When I Tried uncommenting gem 'bcrypt', '~> 3.1.7' and run bundle install again
I get this error.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20160525-19540-1s18rpw.rb extconf.rb
checking if the C compiler accepts ... yes
Building nokogiri using packaged libraries.
Using mini_portile version 2.0.0
checking for gzdopen() in -lz... yes
checking for iconv... yes
************************************************************************
IMPORTANT NOTICE:
Building Nokogiri with a packaged version of libxml2-2.9.2
with the following patches applied:
- 0001-Revert-Missing-initialization-for-the-catalog-module.patch
- 0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch
- 0003-Stop-parsing-on-entities-boundaries-errors.patch
- 0004-Cleanup-conditional-section-error-handling.patch
- 0005-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch
- 0006-Another-variation-of-overflow-in-Conditional-section.patch
- 0007-Fix-an-error-in-previous-Conditional-section-patch.patch
- 0008-CVE-2015-8035-Fix-XZ-compression-support-loop.patch
- 0009-Updated-config.guess.patch
- 0010-Fix-parsering-short-unclosed-comment-uninitialized-access.patch
- 0011-Avoid-extra-processing-of-MarkupDecl-when-EOF.patch
- 0012-Avoid-processing-entities-after-encoding-conversion-.patch
- 0013-CVE-2015-7497-Avoid-an-heap-buffer-overflow-in-xmlDi.patch
- 0014-CVE-2015-5312-Another-entity-expansion-issue.patch
- 0015-Add-xmlHaltParser-to-stop-the-parser.patch
- 0016-Detect-incoherency-on-GROW.patch
- 0017-CVE-2015-7500-Fix-memory-access-error-due-to-incorre.patch
- 0018-CVE-2015-8242-Buffer-overead-with-HTML-parser-in-pus.patch
- 0019-Do-not-print-error-context-when-there-is-none.patch
- 0020-xmlStopParser-reset-errNo.patch
- 0021-Reuse-xmlHaltParser-where-it-makes-sense.patch
Team Nokogiri will keep on doing their best to provide security
updates in a timely manner, but if this is a concern for you and want
to use the system library instead; abort this installation process and
reinstall nokogiri as follows:
gem install nokogiri -- --use-system-libraries
[--with-xml2-config=/path/to/xml2-config]
[--with-xslt-config=/path/to/xslt-config]
If you are using Bundler, tell it to use the option:
bundle config build.nokogiri --use-system-libraries
bundle install
Note, however, that nokogiri is not fully compatible with arbitrary
versions of libxml2 provided by OS/package vendors.
************************************************************************
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0002-Fix-missing-entities-after-CVE-2014-3660-fix.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0003-Stop-parsing-on-entities-boundaries-errors.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0004-Cleanup-conditional-section-error-handling.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0005-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0006-Another-variation-of-overflow-in-Conditional-section.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0007-Fix-an-error-in-previous-Conditional-section-patch.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0008-CVE-2015-8035-Fix-XZ-compression-support-loop.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0009-Updated-config.guess.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0010-Fix-parsering-short-unclosed-comment-uninitialized-access.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0011-Avoid-extra-processing-of-MarkupDecl-when-EOF.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0012-Avoid-processing-entities-after-encoding-conversion-.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0013-CVE-2015-7497-Avoid-an-heap-buffer-overflow-in-xmlDi.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0014-CVE-2015-5312-Another-entity-expansion-issue.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0015-Add-xmlHaltParser-to-stop-the-parser.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0016-Detect-incoherency-on-GROW.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0017-CVE-2015-7500-Fix-memory-access-error-due-to-incorre.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0018-CVE-2015-8242-Buffer-overead-with-HTML-parser-in-pus.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0019-Do-not-print-error-context-when-there-is-none.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0020-xmlStopParser-reset-errNo.patch... OK
Running git apply with /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/patches/libxml2/0021-Reuse-xmlHaltParser-where-it-makes-sense.patch... OK
Running 'configure' for libxml2 2.9.2... OK
Running 'compile' for libxml2 2.9.2... ERROR, review '/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/compile.log' to see what happened. Last lines are:
========================================================================
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2/include/libxml'
make[3]: Entering directory `/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2/include'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2/include'
make[2]: Leaving directory `/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2/include'
Making all in .
make[2]: Entering directory `/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2'
CC SAX.lo
CC entities.lo
CC encoding.lo
CC error.lo
CC parserInternals.lo
CC parser.lo
virtual memory exhausted: Cannot allocate memory
make[2]: *** [parser.lo] Error 1
make[2]: Leaving directory `/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2/ext/nokogiri/tmp/x86_64-unknown-linux-gnu/ports/libxml2/2.9.2/libxml2-2.9.2'
make: *** [all] Error 2
========================================================================
*** 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/local/rvm/rubies/ruby-2.2.1/bin/$(RUBY_BASE_NAME)
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
/home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:366:in `block in execute': Failed to complete compile task (RuntimeError)
from /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:337:in `chdir'
from /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:337:in `execute'
from /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:111:in `compile'
from /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/mini_portile2-2.0.0/lib/mini_portile2/mini_portile.rb:150:in `cook'
from extconf.rb:289:in `block (2 levels) in process_recipe'
from extconf.rb:182:in `block in chdir_for_build'
from extconf.rb:181:in `chdir'
from extconf.rb:181:in `chdir_for_build'
from extconf.rb:288:in `block in process_recipe'
from extconf.rb:187:in `tap'
from extconf.rb:187:in `process_recipe'
from extconf.rb:478:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /home/vinod/dride/vendor/bundle/ruby/2.2.0/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /home/vinod/dride/vendor/bundle/ruby/2.2.0/extensions/x86_64-linux/2.2.0/nokogiri-1.6.7.2/gem_make.out
An error occurred while installing nokogiri (1.6.7.2), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.7.2'` succeeds before bundling.
When I increased the Memory & Size of droplet from 521MB to 2GB, this all errors gone and it worked for me.
I'm following this guide as part of a web development curriculum, so I'm sure I'll fully understand what each part does later on, but for now I'm just doing what it says and figuring out everything I can based on what I know. The previous chapter (creating an app) was a success, but now I've stumbled against this instruction. I can't edit that line because it doesn't exist. This is Gemfile, as viewed in TextEdit:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use jdbcsqlite3 as the database for Active Record
gem 'activerecord-jdbcsqlite3-adapter'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyrhino'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
The app runs fine and the server runs fine (though it doesn't have to be running for this so I guess it's not all that relevant). There's very likely something wrong with the guide, but what is it? Is there any point in building this now or should I keep learning and come back to it when I have more knowledge of Rails, and Ruby itself for that matter?
EDIT: I added the lines at the end of Gemfile and ran bundle install (thanks #Antarr Byrd!) but I got an error message. I'm posting the entire log just in case:
Mac-2:test_app mac$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies.............
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.5.1
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.1
Using builder 3.2.2
Using erubis 2.7.0
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.6
Using loofah 2.0.1
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.1
Using rack 1.6.0
Using rack-test 0.6.3
Using actionpack 4.2.1
Using globalid 0.3.3
Using activejob 4.2.1
Using mime-types 2.4.3
Using mail 2.6.3
Using actionmailer 4.2.1
Using activemodel 4.2.1
Using arel 6.0.0
Using activerecord 4.2.1
Using activerecord-jdbc-adapter 1.3.15
Using jdbc-sqlite3 3.8.7
Using activerecord-jdbcsqlite3-adapter 1.3.15
Using bundler 1.9.1
Using coffee-script-source 1.9.1
Using execjs 2.4.0
Using coffee-script 2.3.0
Using thor 0.19.1
Using railties 4.2.1
Using coffee-rails 4.1.0
Using hike 1.2.3
Using multi_json 1.11.0
Using jbuilder 2.2.12
Using jquery-rails 4.0.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/mac/.rvm/rubies/jruby-1.7.19/bin/jruby -r ./siteconf20150329-367-1xqntht.rb extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.
(root) at /Users/mac/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1071
(root) at /Users/mac/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
(root) at extconf.rb:2
extconf failed, uncaught signal 1
Gem files will remain installed in /Users/mac/.rvm/gems/jruby-1.7.19/gems/pg-0.18.1 for inspection.
Results logged to /Users/mac/.rvm/gems/jruby-1.7.19/extensions/universal-java-1.6/1.9/pg-0.18.1/gem_make.out
An error occurred while installing pg (0.18.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.1'` succeeds before bundling.
gem install pg -v '0.18.1' is also giving me trouble.
Mac-2:test_app mac$ gem install pg -v '0.18.1'
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/Users/mac/.rvm/rubies/jruby-1.7.19/bin/jruby -r ./siteconf20150329-383-1d9a2xw.rb extconf.rb
NotImplementedError: C extension support is not enabled. Pass -Xcext.enabled=true to JRuby or set JRUBY_OPTS.
(root) at /Users/mac/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/mkmf.rb:8
require at org/jruby/RubyKernel.java:1071
(root) at /Users/mac/.rvm/rubies/jruby-1.7.19/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1
(root) at extconf.rb:2
extconf failed, uncaught signal 1
Gem files will remain installed in /Users/mac/.rvm/gems/jruby-1.7.19/gems/pg-0.18.1 for inspection.
Results logged to /Users/mac/.rvm/gems/jruby-1.7.19/extensions/universal-java-1.6/1.9/pg-0.18.1/gem_make.out
I'm stumped about these error messages. If anyone can explain at least the basics of what's going on and how to fix it I'd really appreciate it.
EDIT 2: I tried updating Ruby to 2.2 and it says I need clang 3.0 or higher, which I do have. This is the same problem I had earlier today when trying to install Python 3 and I still can't figure out what I'm doing wrong.
Mac-2:~ mac$ rvm install 2.2
ruby-2.2.0 - #removing src/ruby-2.2.0..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.6/i386/ruby-2.2.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx_brew.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/mac/.rvm/rubies/ruby-2.2.0, this may take a while depending on your cpu(s)...
ruby-2.2.0 - #downloading ruby-2.2.0, this may take a while depending on your connection...
ruby-2.2.0 - #extracting ruby-2.2.0 to /Users/mac/.rvm/src/ruby-2.2.0....
ruby-2.2.0 - #applying patch /Users/mac/.rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch.
ruby-2.2.0 - #configuring.
Error running './configure --prefix=/Users/mac/.rvm/rubies/ruby-2.2.0 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared',
showing last 15 lines of /Users/mac/.rvm/log/1427607081_ruby-2.2.0/configure.log
[2015-03-29 02:31:46] ./configure
current path: /Users/mac/.rvm/src/ruby-2.2.0
GEM_HOME=/Users/mac/.rvm/gems/jruby-1.7.19
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/mac/.rvm/gems/jruby-1.7.19/bin:/Users/mac/.rvm/gems/jruby-1.7.19#global/bin:/Users/mac/.rvm/rubies/jruby-1.7.19/bin:/usr/local/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin/python:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/usr/X11/bin:/Users/mac/.rvm/bin
GEM_PATH=/Users/mac/.rvm/gems/jruby-1.7.19:/Users/mac/.rvm/gems/jruby-1.7.19#global
command(5): ./configure --prefix=/Users/mac/.rvm/rubies/ruby-2.2.0 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared
config.guess already exists
config.sub already exists
checking build system type... i386-apple-darwin10.8.0
checking host system type... i386-apple-darwin10.8.0
checking target system type... i386-apple-darwin10.8.0
i686-apple-darwin10-gcc-4.2.1: error trying to exec 'cc1': execvp: No such file or directory
configure: error: clang version 3.0 or later is required
There has been an error while running configure. Halting the installation.
Mac-2:~ mac$ ruby -v
jruby 1.7.19 (1.9.3p551) 2015-01-29 20786bd on Java HotSpot(TM) 64-Bit Server VM 1.6.0_65-b14-462-10M4609 +jit [darwin-x86_64]
Mac-2:~ mac$ which clang
/usr/bin/clang
Mac-2:~ mac$ clang -v
Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin10.8.0
Thread model: posix
EDIT 3: fixed it without having to update LLVM or Clang or anything. I just had to get rid of jruby and use Ruby 2.2 instead.
Mac-2:rubies mac$ rm -rf jruby-1.7.19/
Mac-2:rubies mac$ brew install ruby
Mac-2:test_app mac$ gem install pg -v '0.18.1'
Mac-2:test_app mac$ bundle install
Even though I'm having some issues with Heroku itself, this was successful, so I'm accepting Antarr Byrd's answer.
Just add it to you Gemfile and do bundle install
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.1'
# Use jdbcsqlite3 as the database for Active Record
gem 'activerecord-jdbcsqlite3-adapter'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
gem 'therubyrhino'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
A couple notes/questions/ideas:
1) Your question subject implies this has something to do with Heroku, but all of your logs / output are from your local Mac. Should edit to reflect that for future answer-seekers
2) You're running using JRuby 1.7, which is a somewhat odd choice for a first app. Looking at the Railsbridge docs you said you were following, they have you use Ruby 2.2, which is a much more common platform. I would follow Step 7 from their guide to get 2.2 installed with RVM and then try it again.
If your database is sqlite then you need to add
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
If it is mysql just replace gem 'sqlite3' with gem 'mysql2'
Using windows 7 ultimate and running cmd as administrator.
I have recently started working with ruby on rails and in my new rails app I'm attempting to install postgres(pg) gem and then I get a permission denied error as shown below:
C:\wamp\www\RailsApp>bundle install
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/...........
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.2
Using minitest 5.5.1
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.8
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.8
Using rack 1.5.2
Using rack-test 0.6.3
Using actionpack 4.1.8
Using mime-types 2.4.3
Using mail 2.6.3
Using actionmailer 4.1.8
Using activemodel 4.1.8
Using arel 5.0.1.20140414130214
Using activerecord 4.1.8
Using coffee-script-source 1.8.0
Using execjs 2.2.2
Using coffee-script 2.3.0
Using thor 0.19.1
Using railties 4.1.8
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.10.1
Using jbuilder 2.2.6
Using jquery-rails 3.1.2
Errno::EACCES: Permission denied # rb_sysopen - C:/Ruby21/lib/ruby/gems/2.1.0/ge
ms/pg-0.18.1-x86-mingw32/lib/2.1/pg_ext.so
An error occurred while installing pg (0.18.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.1'` succeeds before bundling.
I have tried
gem install pg
which leads to the same error.
However... when I try
gem install pg -mingw32
It appears successfull:
C:\wamp\www\RailsApp>gem install pg -mingw32
Fetching: pg-0.18.1-x86-mingw32.gem (100%)
Successfully installed pg-0.18.1-x86-mingw32
invalid options: -f fivefish
(invalid options are ignored)
Parsing documentation for pg-0.18.1-x86-mingw32
Installing ri documentation for pg-0.18.1-x86-mingw32
Done installing documentation for pg after 16 seconds
1 gem installed
Though after searching through several posts I fail to find a solution to how I can implement this with the gemfile to make the bundler run without errors nor find a solution to why I get the permission denied error in the first place.
Here is my current gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.8'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
Note: I have tried using
gem 'pg', platform: :mingw
yet, the error still occurs.
Hope this helps as to make my problem clear and feel free to ask and I'll supply more data possible.
Any suggestions are valued and accepted, thank you.
If you are on windows, use thisgem install pg -mingw32
It looks like bundle is trying to install things in the
C:/Ruby21/lib/ruby/gems/2.1.0/ge
ms/pg-0.18.1-x86-mingw32/lib/2.1/
directory and your user (or the process that is executing bundle) does not have permission to write things to that particular directory.
I am no expert on bundle, but one troubleshooting step you could try is to run a windows command prompt as administrator explicitly. You can do this by searching for CMD, then right-clicking on it and selecting "run as administrator". This sometimes corrects file permissions issues when installing things in windows.