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.
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
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 am on osx 10.6.7 trying to run bundle install on a new rails 3.0.7 app and it keeps failing when trying to build the pg gem. It keeps telling me that I have need the developer tools. But as far as I can tell I have the developer tools installed.
Here is the output of xcodebuild -version
Xcode 3.2.6
Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0
BuildVersion: 10M2518
Here is the output of the failed pg gem build
/Users/bm/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb --with-pg-config=/Library/PostgreSQL/8.4/bin/pg_config
Using config values from /Library/PostgreSQL/8.4/bin/pg_config
checking for libpq-fe.h... *** 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/bm/.rvm/rubies/ruby-1.9.2-head/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
/Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/mkmf.rb:852:in `find_header'
from extconf.rb:31:in `<main>'
Gem files will remain installed in /Users/bm/.rvm/gems/ruby-1.9.2-head#rc_search/gems/pg-0.11.0 for inspection.
Results logged to /Users/bm/.rvm/gems/ruby-1.9.2-head#rc_search/gems/pg-0.11.0/ext/gem_make.out
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:486:in `block in build_extensions'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:446:in `each'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:446:in `build_extensions'
from /Users/bm/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/rubygems/installer.rb:198:in `install'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/source.rb:100:in `install'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/installer.rb:55:in `block in run'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `block in each'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/gems/bundler-1.0.0/bin/bundle:13:in `<top (required)>'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/bin/bundle:19:in `load'
from /Users/bm/.rvm/gems/ruby-1.9.2-head#global/bin/bundle:19:in `<main>'
Any help would be immensely appreciated. FYI I also tried building the app with a mysql and essentially got the same stack. So I'm pretty sure I'm missing some sort of developer build tools, but I just don't know which ones. :(
I had the exact same problem when running bundle install in a Rails app. I installed homebrew and then ran
brew install postgresql.
That finally installed postgres correctly and the issue was fixed for me.
export ARCHFLAGS='-arch x86_64'
export PATH=/Library/PostgreSQL/9.1/bin:${PATH}
gem install pg
If you are using the PostgreSQL app on osx, you may need to change path the following (as the location of the binaries and config files changes) instead of the path shown in lesyk's answer:
export PATH=/Applications/Postgres.app/Contents/MacOS/bin:${PATH}
What worked for me was Zag Zag's comment:
~/projects/foo$ env ARCHFLAGS="-arch x86_64" gem install pg
Building native extensions. This could take a while...
Successfully installed pg-0.11.0
1 gem installed
Building YARD (yri) index for pg-0.11.0...
~/projects/foo$ bundle
...
Using pg (0.11.0)
...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
I had the same issue. For me the fix was:
sudo ln -s gcc /usr/bin/gcc-4.2
I also ran into this issue, for me the answer was updating RVM of all things.
rvm get head
rvm install 1.9.2
I'm on the same OSX and XCode version as you are: bundle install with pg 0.11.0 works fine to me.
However, I found this article that might be able to help you
fixing-the-you-have-to-install-development-tools-first-error-with-nokogiri
If you're using rvm, you can try:
rvm update head
rvm --force install
1.9.2 gem install bundle
Here my stack:
[ 08:36:26 ] > bundle install
Fetching source index for http://rubygems.org/
Enter your password to install the bundled RubyGems to your system:
Using rake (0.8.7)
Using abstract (1.0.0)
Installing activesupport (3.0.7)
Installing builder (2.1.2)
Installing i18n (0.5.0)
Installing activemodel (3.0.7)
Using erubis (2.6.6)
Using rack (1.2.2)
Installing rack-mount (0.6.14)
Installing rack-test (0.5.7)
Installing tzinfo (0.3.27)
Installing actionpack (3.0.7)
Using mime-types (1.16)
Installing polyglot (0.3.1)
Installing treetop (1.4.9)
Installing mail (2.2.19)
Installing actionmailer (3.0.7)
Installing arel (2.0.9)
Installing activerecord (3.0.7)
Installing activeresource (3.0.7)
Using bundler (1.0.10)
Installing pg (0.11.0) with native extensions
Using thor (0.14.6)
Installing railties (3.0.7)
Installing rails (3.0.7)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
[ ronda#MacBook ~/Projects/rails_projects/first_app ]
[ 08:42:57 ] > rails server
=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-04-27 20:45:27] INFO WEBrick 1.3.1
[2011-04-27 20:45:27] INFO ruby 1.9.2 (2011-02-18) [x86_64-darwin10]
[2011-04-27 20:45:27] INFO WEBrick::HTTPServer#start: pid=4757 port=3000
The simple solution:
run brew install postgresql
install the gem with sudo permissions: like so:
sudo gem install pg -v '0.17.1'
I was stuck on my bundle install for 3 days. Tried Everything like adding env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/usr/local/Cellar/postgresql/9.3.5_1/bin/pg_config
I was able to see pg gem getting installed after this command but still it was not installing from bundle install, which was a pain because I dint know what to write in Gemfile except gem 'pg'
The thing which finally worked for me was to find that my pg_config was in /Library/PostgreSQL/9.3/bin/pg_config and by default the Gemfile bundle install looks in /usr/local/bin/pg_config
I just ran the following command and magic happened. bundle config build.pg --with-pg-config=/Library/PostgreSQL/9.3/bin/pg_config
Some correction. For those who have installed postgres using homebrew.
1) write the following line in your ~/.bash_profile
export ARCHFLAGS="-arch x86_64"
2) restart console
3) execute following command
bundle config build.pg --with-pg-config=/usr/local/Cellar/postgresql/9.3.5_1/bin/pg_config (this has to be your pg config address, can differ for each depending on versions of postgres)
4) Install pg once locally by running this command
sudo env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/usr/local/Cellar/postgresql/9.3.5_1/bin/pg_config
5) bundle install
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.
i ran bundle inside a ror project which resulted in following error.
I am unable to understand what is missing.
[root#kracekumar canvas-lms]# bundle
Fetching source index for http://rubygems.org/
Using rake (0.8.7)
Using abstract (1.0.0)
Installing activesupport (2.3.11)
Using rack (1.1.0)
Installing actionpack (2.3.11)
Installing actionmailer (2.3.11)
Installing activerecord (2.3.11)
Installing activeresource (2.3.11)
Installing authlogic (2.1.3)
Using builder (2.1.2)
Using mime-types (1.16)
Installing xml-simple (1.0.12)
Installing aws-s3 (0.6.2)
Installing bluecloth (2.0.10) with native extensions
/usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:481:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/bluecloth-2.0.10 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/bluecloth-2.0.10/ext/gem_make.out
from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
from /usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `run'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `send'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19
[root#kracekumar canvas-lms]#
For Red Hat systems, you can install the pre-requisites like this:
sudo yum -y install make gcc ruby-devel
and it should correctly install the dependencies you need for a native gem install.
This assumes you have Gems already installed, if not, install that as well:
sudo yum -y install rubygems
(Tested on an Amazon EC2 instance, which uses yum.)
It looks like you're probably using Ubuntu. Make sure to install the ruby-dev package for the Ruby headers.
sudo apt-get install ruby-dev
Alternatively, you may look into using RVM to handle Ruby/RubyGems instead.
For your ubuntu you need to install:
ruby developer packages
sudo apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8
sudo apt-get install libreadline-ruby1.8 libruby1.8 libopenssl-ruby