0

On Mac OS X 10.9.2, I use this command line on terminal to install mysql lib for Ruby:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install mysql2

And it shows:

Building native extensions.  This could take a while...
Successfully installed mysql2-0.3.15
Parsing documentation for mysql2-0.3.15
Done installing documentation for mysql2 after 0 seconds
1 gem installed

But I still can not use:

require 'rubygems'
require 'mysql'

It shows :

in `require': cannot load such file -- mysql (LoadError)

What should I do next?

Antony Mithun
  • 161
  • 1
  • 15
zproject89
  • 225
  • 5
  • 19

1 Answers1

2

You have installed the 'mysql2' gem. You need to require that gem within your code:

require 'mysql2'

Then everything should work just fine.

Jon
  • 10,678
  • 2
  • 36
  • 48