Tag: Bundler

Rails 3.0, Mysql2, Ruby 2.1.0 and undefined symbol: __gxx_personality_v0 – mysql2.so

If you encounter this type of error with your not-migrated/really old Rails 3.0 apps:

/app/.bundle/ruby/2.1.0/extensions/x86-linux/2.1.0/mysql2-0.2.18/mysql2/mysql2.so: 
undefined symbol: __gxx_personality_v0 - /app/.bundle/ruby/2.1.0/extensions/x86-linux/2.1.0/mysql2-0.2.18/mysql2/mysql2.so (LoadError)
  /app/.bundle/ruby/2.1.0/gems/mysql2-0.2.18/lib/mysql2.rb:9:in `require'
  /app/.bundle/ruby/2.1.0/gems/mysql2-0.2.18/lib/mysql2.rb:9:in `<top (required)>'
  /home/deploy/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:76:in `require'
  /home/deploy/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
  /home/deploy/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:72:in `each'
  /home/deploy/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:72:in `block in require'
  /home/deploy/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:61:in `each'
  /home/deploy/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.2/lib/bundler/runtime.rb:61:in `require'
  /home/deploy/.rvm/gems/ruby-2.1.0@global/gems/bundler-1.5.2/lib/bundler.rb:131:in `require'
  /app/config/application.rb:3:in `<top (required)>'
  /app/config/environment.rb:2:in `require'
  /app/config/environment.rb:2:in `<top (required)>'
  config.ru:3:in `require'
  config.ru:3:in `block in <main>'

You need to change your mysql2 gem version. You can’t use mysql2 gem version 0.3.*. Instead you need to use branch 0.2.*:

gem 'rails', '~> 3.0'
gem 'mysql2', "~> 0.2.21"

After that just bundle install and the error should be gone.

Ruby 2.1.0-p0 and 2.0.0-p247 – Could not find minitest-4.7.5 in any of the sources

So if you get this message, while doing bundle install:

/ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler/spec_set.rb:92:in `block in materialize':
Could not find minitest-4.7.5 in any of the sources (Bundler::GemNotFound)
from /ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler/spec_set.rb:85:in `map!'
from /ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler/spec_set.rb:85:in `materialize'
from /ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler/definition.rb:114:in `specs'
from /ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler/definition.rb:159:in `specs_for'
from /ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler/definition.rb:148:in `requested_specs'
from /ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler/environment.rb:18:in `requested_specs'
from /ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler/runtime.rb:13:in `setup'
from /ruby/gems/2.1.0-p0/gems/bundler-1.5.0/lib/bundler.rb:120:in `setup'
from /ruby/gems/2.1.0-p0/gems/rubygems-bundler-1.5.0/lib/rubygems-bundler/noexec.rb:74:in `setup'
from /ruby/gems/2.1.0-p0/gems/rubygems-bundler-1.5.0/lib/rubygems-bundler/noexec.rb:103:in `check'
from /ruby/gems/2.1.0-p0/gems/rubygems-bundler-1.5.0/lib/rubygems-bundler/noexec.rb:109:in `<top (required)>'
from /ruby/2.1.0-p0/rubygems/core_ext/kernel_require.rb:110:in `require'
from /ruby/2.1.0-p0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /ruby/2.1.0-p0/rubygems/core_ext/kernel_require.rb:35:in `require'
from /ruby/gems/2.1.0-p0/gems/rubygems-bundler-1.5.0/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
from /ruby/gems/2.1.0-p0/gems/executable-hooks-1.2.4/lib/executable-hooks/hooks.rb:50:in `call'
from /ruby/gems/2.1.0-p0/gems/executable-hooks-1.2.4/lib/executable-hooks/hooks.rb:50:in `block in run'
from /ruby/gems/2.1.0-p0/gems/executable-hooks-1.2.4/lib/executable-hooks/hooks.rb:49:in `each'
from /ruby/gems/2.1.0-p0/gems/executable-hooks-1.2.4/lib/executable-hooks/hooks.rb:49:in `run'
from /Users/smithy/.rbenv/versions/2.1.0-p0-p247/bin/ruby_executable_hooks:10:in `<main>'

You need to update your bundler:

gem update bundler
Updating installed gems
Updating bundler
Fetching: bundler-1.5.2.gem (100%)
Successfully installed bundler-1.5.2
Parsing documentation for bundler-1.5.2
Installing ri documentation for bundler-1.5.2
Installing darkfish documentation for bundler-1.5.2
Gems updated: bundler

Copyright © 2021 Closer to Code

Theme by Anders NorenUp ↑