When I go to install using "sudo bundle install" to install all of them...it throws an error on sqlite3:
Installing sqlite3 (1.3.3) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:533:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3/ext/sqlite3/gem_make.out
from /Library/Ruby/Site/1.8/rubygems/installer.rb:486:in `each'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:486:in `build_extensions'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:159:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/source.rb:96:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:55:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:44:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/cli.rb:225:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.12/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
Then I think maybe I have it already installed because i've used it before...but when I do "rake db:create" it gives me this:
Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in your Gemfile.
What am I doing wrong?
Make sure you have XCode installed. The necessary header files should be installed by that.
Also, unrelated advice, stop using sudo. Look into installing RVM. It will make your life easier.
Related question: Snow Leopard & Ruby on Rails - SQLite3 issue
You may be missing the sqlite3.dll file. Go to the bin folder in your ruby folder and look for a sqlite3.dll file. If you can't find it there then download it for http://www.sqlite.org/download.html. Then put the dll file in your bin(ruby's bin) folder and run bundle install again and see if that works.
Related
I'm following this tutorial on ruby on rails(https://www.youtube.com/watch?v=fmyvWz5TUWg), and at 22:16 he creates a new project with "rails new friends". When I tried to do that, some files are created then the following errors occur below:
Fetching puma 5.6.2
Installing bindex 0.8.1 with native extensions
Installing sqlite3 1.4.2 with native extensions
Installing msgpack 1.4.5 with native extensions
Installing puma 5.6.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bindex-0.8.1/ext/skiptrace
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/3.1.0 -r
./siteconf20220311-6336-mx8y4n.rb extconf.rb
creating Makefile
current directory:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bindex-0.8.1/ext/skiptrace
make DESTDIR\= clean
bash.exe: warning: could not find /tmp, please create!
current directory:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bindex-0.8.1/ext/skiptrace
make DESTDIR\=
generating cruby-x64-mingw-ucrt.def
bash.exe: warning: could not find /tmp, please create!
compiling cruby.c
make: gcc: No such file or directory
make: *** [Makefile:246: cruby.o] エラー 127
make failed, exit code 2
Gem files will remain installed in
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bindex-0.8.1 for inspection.
Results logged to
C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/bindex-0.8.1/gem_make.out
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in `run'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:44:in `block in make'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in `each'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:36:in `make'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:63:in `block in
build'
C:/Ruby31-x64/lib/ruby/3.1.0/tempfile.rb:317:in `open'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in `build'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in `build_extension'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in `block in
build_extensions'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in `each'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in `build_extensions'
C:/Ruby31-x64/lib/ruby/3.1.0/rubygems/installer.rb:853:in `build_extensions'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:28:in `install'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/source/rubygems.rb:204:in `install'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:54:in
`install'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:62:in `apply_func'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:57:in `block in process_queue'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:54:in `loop'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:54:in `process_queue'
C:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:91:in `block (2 levels) in
create_threads'
An error occurred while installing bindex (0.8.1), and Bundler cannot continue.
In Gemfile:
web-console was resolved to 4.2.0, which depends on
bindex
run bundle binstubs bundler
Could not find gem 'sqlite3 (~> 1.4)' in locally installed gems.
rails importmap:install
Could not find gem 'sqlite3 (~> 1.4)' in locally installed gems.
Run `bundle install` to install missing gems.
rails turbo:install stimulus:install
Could not find gem 'sqlite3 (~> 1.4)' in locally installed gems.
Run `bundle install` to install missing gems.
I have tried:
$ bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"
and
gem install puma -v '4.3.0' -- --with-ldflags=-L/usr/local/opt/openssl#1.1/lib --with-cppflags=-I/usr/local/opt/openssl#1.1/include --with-cflags="-Wno-error=implicit-function-declaration"
and still the same error occurs!
Any suggestions on what I should do or how I can fix this?
Try running this:
bundle config set --global build.puma --with-cflags=-fms-extensions
& then run bundle install again
I'm a beginner in Rails and I've followed ruby.railstutorials.org until I stuck with this section http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:1.4.1
after I installed heroku gem by gem install heruku
I typed heroku keys:add then I got these errors.
/Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'jquery-rails (= 2.0.0) ruby' in the gems available on this machine. (Bundler::GemNotFound)
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:161:in `start'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:128:in `block in resolve'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `catch'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `resolve'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/definition.rb:192:in `resolve'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in `specs'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/bundler-1.1.4/lib/bundler/environment.rb:27:in `specs'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:60:in `setup'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
from /Users/xxx/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/xxx/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/xxx/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/xxx/.rvm/gems/ruby-1.9.3-p194#rails3tutorial2ndEd/bin/ruby_noexec_wrapper:9:in `<main>'
abcs-MacBook-Pro-2:first_app xxx$
Could you please let me know how to fix it.
Thanks
Try installing the gem again with the right spelling:
gem install heroku
Check the version of the ruby you are using with
rvm list
ruby -v
gem list
You need to switch to the right ruby with
rvm use <ruby version>
And then install heroku again.
Get Home Brew then run the command "brew doctor". If it tells you that you have errors, fix those errors.
I'm guessing you are on a Mac and that you might be running MacPorts. There are problems with this because MacPorts uses older libs that rvm tries to access. You need to remove opt and a bunch of stuff from your paths where brew doctor complans.
On OS X Lion when trying to start the rails server I get the error
Could not find json-1.5.4 in any of the sources
Run `bundle install` to install missing gems.
If I then run
bundle install json
I get the following errors
Installing json (1.5.4) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:556:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Applications/RubyApps/skatemyspot/json/ruby/1.8/gems/json-1.5.4 for inspection.
Results logged to /Applications/RubyApps/skatemyspot/json/ruby/1.8/gems/json-1.5.4/ext/json/ext/parser/gem_make.out
from /Library/Ruby/Site/1.8/rubygems/installer.rb:509:in `each'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:509:in `build_extensions'
from /Library/Ruby/Site/1.8/rubygems/installer.rb:180:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:101:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:91:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:58:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:57:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:49:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:220:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.18/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
I've seen the answer at nokogiri - ERROR: Failed to build gem native extension but I have Xcode 4.3.2 running.
Any ideas? Thanks
For OS 10.7 + XCode4.3 only open Xcode preferences, select the
"Downloads" button, select the "Components" tab of Downloads, highlight
"Command Line Tools" and press the install button.
On my Ubuntu 10.04 machine I'm having some issues installing RMagick (Ruby's ImageMagick gem), both with the regular imagemagick packages from apt and with ImageMagick compiled from source.
The issue so far is that bundle install fails to install rmagick, whereas RubyGems works just fine. My output is the following:
root#li264-104:/home/user/www/test/public# bundle install
[..cut..]
Installing rmagick (2.13.1) with native extensions /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/local/bin/ruby extconf.rb
Gem files will remain installed in /home/user/www/test/public/vendor/bundle/ruby/1.8/gems/rmagick-2.13.1 for inspection.
Results logged to /home/user/www/test/public/vendor/bundle/ruby/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:101:in `install'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/source.rb:91:in `install'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:58:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:57:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:49:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/installer.rb:8:in `install'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/cli.rb:220:in `install'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `send'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/lib/bundler/vendor/thor/base.rb:386:in `start'
from /usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.18/bin/bundle:13
from /usr/local/bin/bundle:19:in `load'
from /usr/local/bin/bundle:19
root#li264-104:/home/user/www/test/public# cat /home/user/www/test/public/vendor/bundle/ruby/1.8/gems/rmagick-2.13.1/ext/RMagick/gem_make.out
/usr/local/bin/ruby extconf.rb
Also, running the last contents of gem_make.out manually runs successfully:
======================================================================
Thu 19Jan12 16:42:10
This installation of RMagick 2.13.1 is configured for
Ruby 1.8.7 (i686-linux) and ImageMagick 6.7.4 Q8
======================================================================
And also installing using RubyGems works just fine on this machine, making it hard to localize the actual error:
root#li264-104:/home/user/www/test/public# gem install rmagick
Building native extensions. This could take a while...
Successfully installed rmagick-2.13.1
1 gem installed
Installing ri documentation for rmagick-2.13.1...
Installing RDoc documentation for rmagick-2.13.1...
I'm definitely hoping anyone has some pointers. The behavior found looks a lot like the issue in curb gem installation: bundle install fails, but normal gem install works, sadly this issue has no solution posted (and I'm not short on memory). Thanks in advance!
I've been unable to find any solution for the issue and instead installed rvm, which did work correctly.
I'm running bundle install on my staging environment on my Ubuntu machine. It keeps failing trying to install json 1.4.6 with the native extensions.
Using bundler (1.0.7)
Installing thor (0.14.6)
Installing railties (3.0.3)
Installing rails (3.0.3)
Installing geokit-rails3 (0.1.2)
Installing json (1.4.6) with native extensions /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/bin/ruby1.8 extconf.rb
Gem files will remain installed in /u/apps/uat.nicetripper.com/shared/bundle/ruby/1.8/gems/json-1.4.6 for inspection.
Results logged to /u/apps/example.com/shared/bundle/ruby/1.8/gems/json-1.4.6/ext/json/ext/generator/gem_make.out
from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:446:in `each'
from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
from /usr/local/lib/site_ruby/1.8/rubygems/installer.rb:198:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `run'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `send'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
I already have the json gem (1.4.6) gem installed on this machine and it installed with native extensions fine.
root#ve:/code# gem install json
Building native extensions. This could take a while...
Successfully installed json-1.4.6
1 gem installed
I don't understand why bundler is having such a problem with this. I'm running bundler 1.0.7.
Please help because json 1.4.6 has to be included as a dependency for another vital gem.
It's very possible that the Ubuntu provided Ruby or RubyGems is broken. I really recommend you install Ruby using RVM, as described in this post: Ubuntu, Ruby, RVM, Rails, and You.
If you still have trouble with the json gem even after using rvm, it'll likely be much easier to debug as you'll be using something closer to what most other Rubyists do.
I had the same issue as Simon in Ubuntu 12.04 with stock ruby 1.8. I was trying to install Redmine and Bundler (sudo bundle install) kept failed withthe same error when building the json gem. sudo gem install json worked just fine, so I did that and then installed the rest of the app's requirements with Bundler. Hope this helps someone.