I'm trying to install ruby mysql gem. After
gem install mysql I get:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:5:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/mysql-2.9.1 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/mysql-2.9.1/ext/mysql_api/gem_make.out
I found this answer recommending installing
ruby-dev, but after either
apt-get install ruby1.9.1-dev or
apt-get install ruby-dev I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ruby1.9.1-dev : Depends: libruby1.9.1 (= 220.127.116.11-8.1ubuntu2) but 18.104.22.168-8.1ubuntu2.1 is to be installed
Recommends: ruby1.9.1 (= 22.214.171.124-8.1ubuntu2) but 126.96.36.199-8.1ubuntu2.1 is to be installed
E: Unable to correct problems, you have held broken packages.
1) How can I fix this problem?
2) Even more interestingly: as the problem occurs on a fresh xubuntu installation, what causes this type of errors? Have I managed to break something unknowingly? I'll appreciate a link to a resource which will help me get some understanding about the ways of the Ubuntu package manager and dependencies under Linux.
I meet the same problem on Ubuntu 14.04. I remove all the ruby ,ruby-1.9 ,ruby-dev package and re-install ruby and ruby-dev. It seems that I can install ruby software by gem now.