Installing the MySQL Driver

5 views
Skip to first unread message

dwhitekiss

unread,
Nov 25, 2009, 11:46:30 PM11/25/09
to Ruby on Rails: Talk
Hi,

I've setting up my ROR environemtn in Ubuntu linux, however, I'm
having difficulties when installing the mysql driver:

# gem install mysql
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
extconf.rb:10:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:10


Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/
mysql-2.8.1 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/mysql-2.8.1/ext/
mysql_api/gem_make.out


Not sure how to deal with the last paragraph.

I googled about the error and tried the suggested
gem install mysql --with-mysql-config=/usr/local/mysql/bin/
mysql_config

but did not work.

Please help!

D

Darian Shimy

unread,
Nov 26, 2009, 12:16:40 AM11/26/09
to rubyonra...@googlegroups.com
You probably need to include the double-hypen if you need to pass
options to the gem:

gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

Darian Shimy
--
http://www.darianshimy.com
http://twitter.com/dshimy
> --
>
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>
>

Johan De Klerk

unread,
Nov 26, 2009, 12:49:45 AM11/26/09
to rubyonra...@googlegroups.com
You can always just install the libmysql-ruby package.

apt-get install libmysql-ruby

Johan

Prolific Coder

unread,
Nov 26, 2009, 4:08:30 AM11/26/09
to rubyonra...@googlegroups.com
I remember seeing this error recently when I did not install ruby1.8-dev package.

Try this -

sudo aptitude install ruby build-essential libopenssl-ruby ruby1.8-dev


I followed instructions at - https://help.ubuntu.com/community/RubyOnRails and it always helped me.


On Wed, Nov 25, 2009 at 8:46 PM, dwhitekiss <dwhit...@gmail.com> wrote:

Darwin Pintado

unread,
Nov 26, 2009, 1:36:19 PM11/26/09
to rubyonra...@googlegroups.com
Thanks prolific.coder, I can see the rubygems installed.

# aptitude install ruby build-essential libopenssl-ruby ruby1.8-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Initializing package states... Done
Writing extended state information... Done
The following NEW packages will be installed:
  libopenssl-ruby libopenssl-ruby1.8{a} ruby1.8-dev
0 packages upgraded, 3 newly installed, 0 to remove and 98 not upgraded.
Need to get 702kB of archives. After unpacking 2200kB will be used.
Do you want to continue? [Y/n/?] y
Writing extended state information... Done
Get:1 http://ph.archive.ubuntu.com intrepid-updates/universe libopenssl-ruby1.8 1.8.7.72-1ubuntu0.2 [121kB]
Get:2 http://ph.archive.ubuntu.com intrepid/universe libopenssl-ruby 4.2 [5008B]
Get:3 http://ph.archive.ubuntu.com intrepid-updates/main ruby1.8-dev 1.8.7.72-1ubuntu0.2 [576kB]
Fetched 702kB in 10s (69.0kB/s)
Selecting previously deselected package libopenssl-ruby1.8.
(Reading database ... 27583 files and directories currently installed.)
Unpacking libopenssl-ruby1.8 (from .../libopenssl-ruby1.8_1.8.7.72-1ubuntu0.2_i386.deb) ...
Selecting previously deselected package libopenssl-ruby.
Unpacking libopenssl-ruby (from .../libopenssl-ruby_4.2_all.deb) ...
Selecting previously deselected package ruby1.8-dev.
Unpacking ruby1.8-dev (from .../ruby1.8-dev_1.8.7.72-1ubuntu0.2_i386.deb) ...
Setting up libopenssl-ruby1.8 (1.8.7.72-1ubuntu0.2) ...
Setting up libopenssl-ruby (4.2) ...
Setting up ruby1.8-dev (1.8.7.72-1ubuntu0.2) ...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done

# gem -v
1.3.5
Reply all
Reply to author
Forward
0 new messages