LoginSignup
0
0

More than 5 years have passed since last update.

How to `gem install mysql -v 2.7`

Last updated at Posted at 2013-02-11

TypeError: can't dup NilClass

If you get an error something like below while bundle install

Installing mysql (2.7) with native extensions
TypeError: can't dup NilClass
An error occurred while installing mysql (2.7), and Bundler cannot continue.
Make sure that `gem install mysql -v '2.7'` succeeds before bundling.

First, check your gem's version by executing

$ gem -v

If it's newer then 1.5.x, like 1.6.x or above, that's your problem.

Newer versions of Rubygems doesn't play well with the mysql gem.

So downgrade the gem, and retry gem install mysql -v 2.7.

You can downgrade the gem by:

$ gem list rubygems-update

*** LOCAL GEMS ***
rubygems-update (1.7.2)

$ sudo gem uninstall -v 1.7.2 rubygems-update # uninstall all the local rubygem-update versions if it's newer then 1.5.x
$ sudo gem install -v 1.5.2 rubygems-update
$ sudo update_rubygems
$ gem -v
1.5.2
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0