I created a VM running the latest Ubuntu because it was causing so many problems on my Windows machine.
I got RVM installed, have versions 1.8.7 and 1.9.2 setup with 1.9.2 as the default. I installed gems, installed Rails.
If I try to do anything with Rails (generate, server, etc.) I get this error:
You have requested: mysql2 ~> 0.2.6
The bundle currently has mysql2 locked
at 0.2.6. Try runningbundle update
mysql2
First problem, my rails app isn’t even using mysql. It’s using SQLite.
Anyway, I run bundle update mysql2 like it says…and I get a bunch of errors. The start of them is this:
Installing mysql2 (0.2.6) with native extensions /home/jamesw/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
/home/jamesw/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
I am not good with server setup and things like this. I am an OS X user, but didn’t have to deal with any of this on OS X. Can anyone point me in the right direction?
Look in the Gemfile and see if there is a line that looks like either of the following.
If there are, comment out or delete these lines, remove Gemfile.lock and run bundle install again.