From: James Harrison Date: 2010-05-19T02:52:09+09:00 Subject: Re: sudo gem install mysql problem On May 18, 2010, at 12:35 AM 5/18/10, lyn wrote: > On May 5, 11:41 pm, Pen Ttt wrote: >> today i have installed ubuntu10.04. >> pt@pt-laptop:~$ ruby -v >> ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux] >> pt@pt-laptop:~$ gem -v >> 1.3.5 >> pt@pt-laptop:~$ sudo 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 /var/lib/gems/1.8/gems/mysql-2.8.1 >> for inspection. >> Results logged to >> /var/lib/gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out >> >> how to sovle the problem? >> -- >> Posted viahttp://www.ruby-forum.com/. > > I was getting the exact same error - I can get sudo gem install mysql > to load only after running sudo apt-get install ruby-dev but then > rails app reports wrong wrong gem version and asks me to 2.2.3 back > from 2.2.5 sudo gem install -v=2.2.3 rails run app and web brick > starts and displays default page go to generators scaffold works then > rake db migrate you should get a password error alter user name and > password for all environments and I am hoping that works > As much as this might not be what you want to hear, I've always eventually given up on trying to use apt on ubuntu for ruby related stuff. Something funky's up with their debs. Instead, I install ruby from source and then use the various scripts inside the source tarball to install almost everything else I need. It's much simpler in the long run, though you'll have to do upgrades by hand.