Gem::Ext::BuildError: ERROR: Failed to build gem native extension Mavericks - ruby-on-rails

am learning rails using this website http://tutorials.jumpstartlab.com/projects/blogger.html and whenever I try starting the server using rails server, I get this error on the terminal
Could not find gem 'sqlite3 (>= 0) ruby' in the gems available on this machine.
Run `bundle install` to install missing gems.
After running the command bundle install, I get the error:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/local/Cellar/ruby/2.1.2_3/bin/ruby extconf.rb
/Users/andrewmolo/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:in `initialize': Permission denied # rb_sysopen - /usr/local/Cellar/ruby/2.1.2_3/bin/rake (Errno::EACCES)
from /Users/UserX/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:in `open'
from /Users/UserX/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:71:in `block in try_to_fix_binstubs'
from /Users/UserX/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:69:in `map'
from /Users/UserX/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:69:in `try_to_fix_binstubs'
from /Users/UserX/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:46:in `block in execute_no_wrapper'
from /Users/UserX/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:44:in `each'
from /Users/UserX/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/executable-hooks-1.3.2/lib/executable-hooks/regenerate_binstubs_command.rb:44:in `execute_no_wrapper'
from extconf.rb:19:in `<main>'
bundler 1.9.1
erubis 2.7.0
executable-hooks 1.3.2
nokogiri 1.6.6.2
rack 1.6.0
railties 4.2.1
rake 10.1.0
extconf failed, exit code 1
Gem files will remain installed in /Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/executable-hooks-1.3.2 for inspection.
Results logged to /Users/UserX/.rvm/gems/ruby-2.2.0#global/extensions/x86_64-darwin-13/2.1.0/executable-hooks-1.3.2/gem_make.out
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/tempfile.rb:324:in `open'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/specification.rb:1436:in `block in build_extensions'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/user_interaction.rb:45:in `use_ui'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/specification.rb:1434:in `build_extensions'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/stub_specification.rb:60:in `build_extensions'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/basic_specification.rb:56:in `contains_requirable_file?'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/specification.rb:925:in `block in find_inactive_by_path'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/specification.rb:924:in `each'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/specification.rb:924:in `find_inactive_by_path'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems.rb:185:in `try_activate'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132:in `rescue in require'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/vendor/net/http/persistent.rb:12:in `<top (required)>'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/vendored_persistent.rb:11:in `<top (required)>'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Cellar/ruby/2.1.2_3/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/fetcher.rb:1:in `<top (required)>'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/cli/install.rb:72:in `run'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/cli.rb:157:in `install'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/cli.rb:10:in `start'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/bin/bundle:20:in `block in <top (required)>'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
/Users/UserX/.rvm/gems/ruby-2.2.0#global/gems/bundler-1.9.1/bin/bundle:18:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Environment
Bundler 1.9.1
Rubygems 2.2.2
Ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]
GEM_HOME /Users/andrewmolo/.rvm/gems/ruby-2.2.0
GEM_PATH /Users/andrewmolo/.rvm/gems/ruby-2.2.0:/Users/andrewmolo/.rvm/gems/ruby-2.2.0#global
RVM 1.26.10 (latest)
Git 1.8.5.2
rubygems-bundler (1.4.4)
OS = Mavericks 10.9.5

I don't know if this will help people with this issue but I was having the same error. What I ended up doing to fix it is commenting out the sqlite gem in my gemfile for the app. Granted I just did this a few minutes ago so I don't know if I'll run into any other issues but I use Postgres so if you use something else too, there shouldn't be an issue. Hope this helps others like me that were looking for answers.

Looks like bundler has no permission to write into your file system.
Permission denied # rb_sysopen - /usr/local/Cellar/ruby/2.1.2_3/bin/rake (Errno::EACCES)
Try running your command as sudo:
sudo bundle install

I believe the issue is the Gemfile.lock thats not allowing you to use the latest version of of each of your gems.
To update your Gemfile.lock run the command:
bundle update
in the same directory as your Gemfile.lock file then try bundle install again.

Related

can't find gem bundler Ruby

Using Mac OS 13, rbenv.
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
Rails 5.1.4
Bundler version 1.16.1
rbenv 1.1.1
I'm trying to start a new Rails application and then getting this:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems.rb:241:in `bin_path': can't find gem bundler (>= 0) (Gem::GemNotFoundException)
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/generators/app_base.rb:382:in `bundle_command'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/generators/app_base.rb:416:in `run_bundle'
from (eval):1:in `run_bundle'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `block in invoke_all'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `each'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `map'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:133:in `invoke_all'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/group.rb:232:in `dispatch'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/base.rb:466:in `start'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/commands/application/application_command.rb:24:in `perform'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
from /Library/Ruby/Gems/2.3.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in `perform'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/command.rb:44:in `invoke'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/lib/rails/cli.rb:16:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from /Library/Ruby/Gems/2.3.0/gems/railties-5.1.4/exe/rails:9:in `<top (required)>'
from /usr/local/bin/rails:22:in `load'
from /usr/local/bin/rails:22:in `<main>'
As I understand it has something to do with a version of Ruby but I have no idea how to resolve the issue.
It looks like you may need to do a gem install bundler and get the bundler gem to get rails up and running.
STEP (1): install the bundler gem:
sudo gem install bundler
Once completed, you should get a message similar to this:
Fetching: bundler-1.16.1.gem (100%)
Successfully installed bundler-1.16.1
Parsing documentation for bundler-1.16.1
Installing ri documentation for bundler-1.16.1
Done installing documentation for bundler after 6 seconds
1 gem installed
STEP (2): try checking the bundler version:
bundle -v
You should get a version number like this:
Bundler version 1.16.1
STEP (3): now you can use bundle install:
bundle install
I hope my answer helps.

Ruby on Rails - Postgres error when trying to start Rails Server

I am using:
ruby 2.2.1
rails 4.6.2
homebrew for postgres installation
rbenv
osx el capitan 10.11.5
Here is the error I receive when running:
rails s
/usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg.rb:4:in `require': dlopen(/usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg_ext.bundle, 9): Library not loaded: /usr/local/lib/libruby.2.2.0.dylib (LoadError)
Referenced from: /usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg_ext.bundle
Reason: image not found - /usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg_ext.bundle
from /usr/local/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
from /Users/jeffr/Dropbox/DevelopmentPC/rails4/myapp/config/application.rb:7:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `require'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/jeffr/Dropbox/DevelopmentPC/rails4/myapp/bin/rails:9:in `require'
from /Users/jeffr/Dropbox/DevelopmentPC/rails4/myapp/bin/rails:9:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in `load'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/client/rails.rb:28:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/client/command.rb:7:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/client.rb:30:in `run'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/bin/spring:49:in `<top (required)>'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/binstub.rb:11:in `load'
from /usr/local/lib/ruby/gems/2.2.0/gems/spring-1.7.1/lib/spring/binstub.rb:11:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/jeffr/Dropbox/DevelopmentPC/rails4/myapp/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I ended up starting over with the entire rbenv, ruby and rails installation.
brew update
brew uninstall --force ruby
brew uninstall --force openssl
brew install openssl
brew link openssl --force
brew uninstall --force ruby-build
Then I followed this guide and it worked:
https://gorails.com/setup/osx/10.11-el-capitan
Except for the libxml2 error while installing rails:
libxml2 is missing. Please locate mkmf.log to investigate how it is failing.
I fixed that by running
$ gem install nokogiri -- --use-system-libraries [--with-xml2-config=/path/to/xml2-config] [--with-xslt-config=/path/to/xslt-config]

Error while running bundle in rails 4.2.4

I tried running bundle over rbenv but I got this error:
/home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require': cannot load such file -- bundler (LoadError)
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/app_base.rb:319:in `bundle_command'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/generators/app_base.rb:335:in `run_bundle'
from (eval):1:in `run_bundle'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/commands/plugin.rb:23:in `<top (required)>'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/lib/rails/cli.rb:12:in `<top (required)>'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:69:in `require'
from /home/armyalone/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.4/bin/rails:9:in `<top (required)>'
from /home/armyalone/.rbenv/versions/2.2.3/bin/rails:23:in `load'
from /home/armyalone/.rbenv/versions/2.2.3/bin/rails:23:in `<main>'
Then I tried these commands:
$ gem -v
2.5.0
$ rails -v
Rails 4.2.4
$ bundle -v
Bundler version 1.10.6
$ rbenv -v
rbenv 0.4.0-205-g5fb9c84
Why can't I run bundler?
Run the below command in your terminal
gem install rb-readline
Hope it helps!
I changed the source from https://rubygems.org to http://rubygems.org and ran:
gem update --system
bundle install
now it's working.

Bundler Error - http.rb:799:in `connect': SSL_set_tlsext_host_name: (OpenSSL::SSL::SSLError)

I migrated the gems from ruby-1.9.2 to ruby-1.9.3 and then tried to run bundle install. When I did, I got the error above. Any clue as to why?
Using rvm 1.9.2, ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux], bundler 1.1.4, and rubygems 1.8.24
Error stack:
user#linux-kt6v:~/rails_projects/rails_app> bundle install
Fetching gem metadata from https://rubygems.org/.Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/user/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect': SSL_set_tlsext_host_name: (OpenSSL::SSL::SSLError)
from /home/user/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `block in connect'
from /home/user/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
from /home/user/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
from /home/user/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799:in `connect'
from /home/user/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
from /home/user/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:750:in `start'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/vendor/net/http/persistent.rb:224:in `connection_for'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/vendor/net/http/persistent.rb:358:in `request'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/fetcher.rb:145:in `fetch'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/fetcher.rb:173:in `fetch_dependency_remote_specs'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/fetcher.rb:132:in `fetch_remote_specs'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/fetcher.rb:70:in `specs'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/source.rb:234:in `block in remote_specs'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/source.rb:232:in `each'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/source.rb:232:in `remote_specs'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/source.rb:165:in `fetch_specs'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/source.rb:70:in `specs'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/lazy_specification.rb:53:in `__materialize__'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/spec_set.rb:86:in `block in materialize'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/spec_set.rb:83:in `map!'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/spec_set.rb:83:in `materialize'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in `specs'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/definition.rb:122:in `resolve_remotely!'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/installer.rb:48:in `run'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/installer.rb:12:in `install'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/cli.rb:220:in `install'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/vendor/thor/task.rb:22:in `run'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/lib/bundler/vendor/thor/base.rb:386:in `start'
from /home/user/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.4/bin/bundle:13:in `<top (required)>'
from /home/user/.rvm/gems/ruby-1.9.3-p0/bin/bundle:23:in `load'
from /home/user/.rvm/gems/ruby-1.9.3-p0/bin/bundle:23:in `<main>'
It looks like you need some updates:
curl -L get.rvm.io | bash # get latest RVM
rvm reload # load installed version
rvm autolibs enable # enable automatic libraries installation
rvm remove 1.9.3 # remove installed ruby
rvm install 1.9.3 # install it again - including proper libraries

Bundle command the wrong mysql2 gem (always 0.3.2)

I got an error when trying to run $rails console
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.16.dylib (LoadError)
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2/mysql2.bundle
from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.2/lib/mysql2.rb:8
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:112:in `require'
from /Users/ccool2486/Sites/test3mysql/config/application.rb:7
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:21:in `require'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:21
from script/rails:6:in `require'
from script/rails:6
ccool-2:test3mysql ccool2486$ rails console
WARNING: This version of mysql2 (0.3.2) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1
WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x
/Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `establish_connection': Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- active_record/connection_adapters/mysql2_adapter) (RuntimeError)
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection'
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/railtie.rb:59
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:43:in `run_load_hooks'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/base.rb:1903
from /Library/Ruby/Gems/1.8/gems/activerecord-3.0.6/lib/active_record/railtie.rb:32
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `call'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.0.6/lib/active_support/dependencies.rb:239:in `to_proc'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/railtie.rb:180:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/railtie.rb:180:in `load_console'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/application.rb:154:in `load_console'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/application/railties.rb:11:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/application/railties.rb:11:in `all'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/application.rb:154:in `load_console'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands/console.rb:26:in `start'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands/console.rb:8:in `start'
from /Library/Ruby/Gems/1.8/gems/railties-3.0.6/lib/rails/commands.rb:23
from script/rails:6:in `require'
from script/rails:6
Hmm... so i tried to uninstall the mysql2 gem, and reinstall the version 0.2.7 gem
sudo gem uninstall mysql2 -i /Library/Ruby/Gems/1.8
And I changed the gemfile:
gem 'mysql2','0.2.7'
Ran Bundler in my app directory:
bundle install
But it installed the version 0.3.2 back again!!! Can anyone help, I honestly don't know what happened here.
sudo gem uninstall mysql2
in Gemfile gem 'mysql2', '< 0.3'
bundle update
with your
gem 'mysql2','0.2.7'
Try
bundle update
it builds the bundle from scratch

Resources