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.
Related
I am currently trying to run an application locally but running into some issues with postgreSql.
gem install pg gives me the following:
Fetching gem metadata from http://insecure.rails-assets.org/...
Fetching version metadata from http://insecure.rails-assets.org/..
Fetching gem metadata from http://insecure.rails-assets.org/...
Fetching gem metadata from https://rubygems.org/........
Fetching version metadata from http://insecure.rails-assets.org/..
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from http://insecure.rails-assets.org/..
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.4
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.2
Using actionview 4.2.5
Using rack 1.6.4
Using rack-test 0.6.3
Using actionpack 4.2.5
Using globalid 0.3.6
Using activejob 4.2.5
Using mime-types 2.6.2
Using mail 2.6.3
Using actionmailer 4.2.5
Using active_link_to 1.0.3
Using activemodel 4.2.5
Using arel 6.0.3
Using activerecord 4.2.5
Using addressable 2.3.8
Using extlib 0.9.16
Using multi_json 1.11.2
Using autoparse 0.3.3
Using coderay 1.1.0
Using better_errors 2.1.1
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using bootstrap_form 2.3.0
Using bundler 1.8.4
Using byebug 9.1.0 (was 8.2.0)
Using cancancan 1.13.1
Using chartkick 1.4.1
Using chunky_png 1.3.5
Using coffee-script-source 1.10.0
Using execjs 2.6.0
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.5
Using coffee-rails 4.1.0
Using concurrent-ruby 1.0.0
Using connection_pool 2.2.0
Using unf_ext 0.0.7.1
Using unf 0.1.4
Using domain_name 0.5.24
Using faker 1.6.1
Using multipart-post 2.0.0
Using faraday 0.9.2
Using ffi 1.9.10
Using font-awesome-rails 4.4.0.0
Using formatador 0.2.5
Using friendly_id 5.0.5
Using jwt 2.2.2
Using little-plugger 1.1.4
Using logging 2.0.0
Using memoist 0.12.0
Using signet 0.6.1
Using googleauth 0.4.2
Using launchy 2.4.3
Using retriable 1.4.1
Using google-api-client 0.8.6
Using groupdate 2.4.0
Using rb-fsevent 0.9.6
Using rb-inotify 0.9.5
Using listen 3.0.5
Using lumberjack 1.0.9
Using nenv 0.2.0
Using shellany 0.0.1
Using notiffany 0.0.8
Using method_source 0.8.2
Using slop 3.6.0
Using pry 0.10.3
Using guard 2.13.0
Using guard-compat 1.2.1
Using guard-minitest 2.4.4
Using tilt 2.0.1
Using haml 4.0.7
Using hashie 3.6.0
Using http-cookie 1.0.2
Using jbuilder 2.3.2
Using jquery-rails 4.0.5
Using mini_magick 4.2.7
Using multi_xml 0.5.5
Using netrc 0.10.3
Using oauth2 1.4.4
Using omniauth 1.9.1
Using omniauth-oauth2 1.7.0
Using omniauth-github 1.1.2
Using omniauth-google-oauth2 0.8.0
Using ruby-openid 2.7.0
Using rack-openid 1.3.1
Using omniauth-openid 1.0.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/username/.rbenv/versions/2.2.0/bin/ruby -r ./siteconf20220307-80476-1facihf.rb extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
sh: /Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config: No such file or directory
sh: /Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config: No such file or directory
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/nahomie/.rbenv/versions/2.2.0/bin/$(RUBY_BASE_NAME)
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
extconf failed, exit code 1
Gem files will remain installed in /Users/username/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/pg-0.18.4 for inspection.
Results logged to /Users/username/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-21/2.2.0-static/pg-0.18.4/gem_make.out
An error occurred while installing pg (0.18.4), and Bundler cannot continue.
Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.
gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.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.1.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
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
# gem 'byebug'
gem 'byebug', '~> 9.1'
# 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
# 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]
gem "haml"
gem "omniauth"
gem "omniauth-github"
gem "omniauth-google-oauth2", '~> 0.8.0'
gem "omniauth-openid"
gem "google-api-client"
gem "cancancan"
gem 'bootstrap_form'
gem 'friendly_id', '~> 5.0.0'
gem 'ransack'
gem 'rdiscount', require: 'tilt/rdiscount'
gem 'ruby_identicon'
gem 'sidekiq'
gem "refile", require: "refile/rails"
gem "refile-mini_magick"
gem 'simple_form'
gem 'active_link_to'
gem 'chartkick'
gem 'groupdate'
gem 'faker'
# gem 'skylight'
gem 'bundler', '>= 1.8.4'
source 'http://insecure.rails-assets.org' do
# source 'https://rails-assets.org' do
gem 'rails-assets-bootstrap'
gem 'rails-assets-jasny-bootstrap'
gem 'rails-assets-handlebars'
gem 'rails-assets-datatables'
gem 'rails-assets-datatables-fixedcolumns'
gem 'rails-assets-typeahead.js'
end
gem "font-awesome-rails"
# bring back removed support for respond_with
# gem 'responders', '~> 2.0'
group :production do
gem 'rails_12factor'
gem 'puma'
end
group :development do
gem 'guard'
gem 'guard-minitest'
gem 'better_errors'
gem 'binding_of_caller'
gem 'quiet_assets'
gem 'pry-rails'
end
ruby "2.2.0"
Steps I've tried:
bundle install
gem install pg
gem install pg -v '0.18.4
gem install pg 0.18.4
I also tried to modify the pg in the gemfile with the exact version that was required and then running bundle install
When I tried to run brew install libpq
==> Downloading https://ghcr.io/v2/homebrew/core/libpq/manifests/14.2
Already downloaded: /Users/nahomie/Library/Caches/Homebrew/downloads/84abbc53ffbb8f36dc6dd856d9dcaa4d9b49a9d0f434a334b991f82c22fe63f4--libpq-14.2.bottle_manifest.json
==> Downloading https://ghcr.io/v2/homebrew/core/libpq/blobs/sha256:36b074f07ded99c1945dbcc26f54e45abeba0dbf34d16e63fb6ab16d371158ee
Already downloaded: /Users/nahomie/Library/Caches/Homebrew/downloads/88c1ec435b5360375c672305226528f5ffbfc88c4cb3b1bcf8697e43daa73e21--libpq--14.2.arm64_monterey.bottle.tar.gz
==> Reinstalling libpq
==> Pouring libpq--14.2.arm64_monterey.bottle.tar.gz
==> Caveats
libpq is keg-only, which means it was not symlinked into /opt/homebrew,
because conflicts with postgres formula.
If you need to have libpq first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc
For compilers to find libpq you may need to set:
export LDFLAGS="-L/opt/homebrew/opt/libpq/lib"
export CPPFLAGS="-I/opt/homebrew/opt/libpq/include"
For pkg-config to find libpq you may need to set:
export PKG_CONFIG_PATH="/opt/homebrew/opt/libpq/lib/pkgconfig"
==> Summary
🍺 /opt/homebrew/Cellar/libpq/14.2: 2,336 files, 28.2MB
==> Running `brew cleanup libpq`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Any help would be appreciated.
You need to install libpq.
STEPS
brew install libpq
Find the libpq version by running below command
brew info libpq
Then install pg with
gem install pg — — with-pg-config=/usr/local/Cellar/libpq/[VERSION FROM ABOVE COMMAND]/bin/pg_config
Hope This solves your Problem.
Thank You
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.)
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.
When I try to bundle install or update, it gives me this error:
> bundle install
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.4.1
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.1
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.1
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.1
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 4.1.1
Using activemodel 4.1.1
Using arel 5.0.1.20140414130214
Using activerecord 4.1.1
Using sass 3.2.19
Using bootstrap-sass 3.2.0.0
Using bundler 1.7.3
Using coffee-script-source 1.8.0
Using execjs 2.2.1
Using coffee-script 2.3.0
Using thor 0.19.1
Using railties 4.1.1
Using coffee-rails 4.0.1
Using fullcalendar-rails 1.6.4.0
Using hike 1.2.3
Using multi_json 1.10.1
Using jbuilder 2.1.3
Using jquery-rails 3.1.2
Using tilt 1.4.1
Using sprockets 2.11.0
Using sprockets-rails 2.1.4
Using rails 4.1.1
Using rdoc 4.1.2
Errno::ENOENT: No such file or directory # rb_sysopen - C:/<ruby-app-dir>/vendor/bundle/ruby/2.1.0/gems/sass-rails-4.0.3/test/fixtures/alternate_config_p
roject/app/assets/stylesheets/partials/subfolder/relative_not_a_partial.css.scss
An error occurred while installing sass-rails (4.0.3), and Bundler cannot
continue.
Make sure that `gem install sass-rails -v '4.0.3'` succeeds before bundling.
However, running gem install sass-rails -v '4.0.3' succeeds with no errors.
edit: The file throwing the error does not, in fact, exist, although the sass-rails gem does have such a file. Manually putting in the file doesn't help.
64-bit Windows 8.1 with 32-bit Ruby, although I got the same error on 64-bit ruby.
gem -v: 2.2.2
bundle -v: 1.7.3
Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# 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
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development
# bootstrap!
gem 'bootstrap-sass'
gem 'fullcalendar-rails'
# 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]
Sass is compatible with Ruby 2 as of version 3.1.18, so that shouldn't be an issue.
try to run gem install saas-rails in your working directory.
https://rubygems.org/gems/sass-rails