Incorrect MySQL client library version! This gem was compiled for 5.5.37 but the client library is 5.6.25 [duplicate] - mysql

This question already has answers here:
mysql2 gem compiled for wrong mysql client library
(8 answers)
Closed 6 years ago.
I upgraded my Ubuntu from 2014.04 to 2015.04 and now bundle exec rake db:migrate returns an error:
$ bundle exec rake db:migrate --trace
rake aborted!
Incorrect MySQL client library version! This gem was compiled for 5.5.37 but the client library is 5.6.25.
/home/nico/.rvm/gems/ruby-1.9.3-p362/gems/mysql2-0.2.11/lib/mysql2.rb:9:in `require'
/home/nico/.rvm/gems/ruby-1.9.3-p362/gems/mysql2-0.2.11/lib/mysql2.rb:9:in `<top (required)>'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `block in require'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
/home/nico/myapp/config/application.rb:7:in `<top (required)>'
/home/nico/myapp/Rakefile:4:in `require'
/home/nico/myapp/Rakefile:4:in `<top (required)>'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/bin/rake:19:in `load'
/home/nico/.rvm/gems/ruby-1.9.3-p362#global/bin/rake:19:in `<main>'
/home/nico/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `eval'
/home/nico/.rvm/gems/ruby-1.9.3-p362/bin/ruby_noexec_wrapper:14:in `<main>'
How to solve this problem?
I would rather avoid changing server-side versions.
The answers at I can't run "bundle update" because of "mysql2" gem do not solve the problem.
Local versions:
gem 2.4.8
Rails 3.0.19
mysql Ver 14.14 Distrib 5.6.25

Running these commands solved the problem:
gem uninstall mysql2
bundle install

I ran into the same problem and the accepted answer didn't work for me, most likely because I used capistrano, which installs all gems into a per-app shared directory.
bundle show mysql2
(run in your app's folder) will show you where mysql is installed. Then delete that as well as the the specification.
rm -rf /path/to/application/shared/bundle/ruby/<version>/gems/mysql2-<version>
rm /path/to/application/shared/bundle/ruby/<version>/specifications/mysql2-<version>.gemspec
should do the trick. Alternatively just delete the complete bundle/* and reinstall everything.

Related

Can't get WAMP MySQL to work with Ruby on Rails

I am trying to use my WAMP MySQL for a Ruby on Rails installation on my Windows 7 system. I am getting errors (see below) when I try to start the rails WEBrick server.
I've installed the complete Ruby on Rails environment successfully, including the mysql2 gem. When installing the mysql2 gem, I referenced the location of the lib and includes folders of the WAMP mysql and it successfully installed:
C:\wamp\www\simple_cms>gem install mysql2 --no-document -- '--with-mysql-lib="C:\wamp\bin\mysql\mysql5.5.24\lib\" --with-mysql-include="C:\wamp\bin\mysql\mysql5.5.24\include\"
======================================================================================================
\ You've installed the binary version of mysql2.
It was built using MySQL Connector/C version 6.1.5.
It's recommended to use the exact same version to avoid potential issues.
At the time of building this gem, the necessary DLL files were retrieved from:
http://cdn.mysql.com/Downloads/Connector-C/mysql-connector-c-6.1.5-winx64.zip
\ This gem *includes* vendor/libmysql.dll with redistribution notice in vendor/README.
======================================================================================================
Successfully installed mysql2-0.3.18-x64-mingw32
1 gem installed
I copied the libmysql.dll from "C:\wamp\bin\mysql\mysql5.5.24\lib\libmysql.dll" to "C:\Ruby22-x64\bin\libmysql.dll".
I get the following error when I try to start WEBrick
C:\wamp\www\simple_cms>rails server
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `require': cannot load such file -- mysql2/2.2/mysql2 (LoadError)
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18-x64-mingw32/lib/mysql2.rb:31:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:76:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:72:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:72:in `block in require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:61:in `each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler/runtime.rb:61:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bundler-1.10.4/lib/bundler.rb:134:in `require'
from C:/wamp/www/simple_cms/config/application.rb:7:in `<top (required)>'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `require'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.2/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I have also tried using the libmysql.dll included with the mysql2 gem located at "C:\Ruby22-x64\lib\ruby\gems\2.2.0\gems\mysql2-0.3.18-x64-mingw32\vendor\libmysql.dll" and copying that to "C:\Ruby22-x64\bin\libmysql.dll". That also gave the above errors.
I can access mysql from the command line:
C:\wamp\www\simple_cms>mysql --version
mysql Ver 14.14 Distrib 5.5.24, for Win64 (x86)
I'm not sure what I am doing wrong here. Any help would be appreciated.

Rails on Mac - rake db:create error

I installed RVM and rails on my MAC (Mavericks 10.9.1) and I try to run rake db:create. However I constantly get this error:
MacBook-Pro-Szymon:wybierzto Fengson$ rake db:create
rake aborted!
dlopen(/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle, 9): Library not loaded: /opt/local/lib/mysql5/mysql/libmysqlclient_r.16.dylib
Referenced from: /Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
Reason: image not found - /Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/extensions/x86_64-darwin-12/2.0.0-static/mysql2-0.3.14/mysql2/mysql2.bundle
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `<top (required)>'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `each'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:72:in `block in require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `each'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler/runtime.rb:61:in `require'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#global/gems/bundler-1.5.1/lib/bundler.rb:131:in `require'
/Users/Fengson/UJ/ProjektZespolowy/wybierzto/config/application.rb:12:in `<top (required)>'
/Users/Fengson/UJ/ProjektZespolowy/wybierzto/Rakefile:4:in `require'
/Users/Fengson/UJ/ProjektZespolowy/wybierzto/Rakefile:4:in `<top (required)>'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `eval'
/Users/Fengson/.rvm/gems/ruby-2.0.0-p353#railstutorial_rails_4_0/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
Also, how can I properly install MySQL Server so that I can set a default password? It asked me for a password on Windows machine but here it didn't when I was installing MySQL5 + server. Thanks!
try reinstall mysql through homebrew. and reinstall mysql gem
gem install mysql -- --with-mysql-config path/to/mysql_config

rail servers error? (rails 3) in windows

I created a new project using the command:
rails new simple_cms -d mysql
but when I try to launch the web server, this happens:
C:\Users\johnny\Sites\simple_cms>rails server
C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `require': 193: %1 is not a valid Win32 application. - C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/mysql2.so (LoadError)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/mysql2.rb:2:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2.rb:9:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.1/lib/bundler/runtime.rb:68:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.1/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.1/lib/bundler/runtime.rb:66:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.1/lib/bundler/runtime.rb:66:in `block in require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.1/lib/bundler/runtime.rb:55:in `each'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.1/lib/bundler/runtime.rb:55:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.1/lib/bundler.rb:119:in `require'
from C:/Users/johnny/Sites/simple_cms/config/application.rb:7:in `<top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:53:in `require'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:53:in `block in <top (required)>'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:50:in `tap'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.2/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
C:\Users\johnny\Sites\simple_cms>
Some version info just in case:
C:\Users\j\Sites\simple_cms>ruby -v
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
C:\Users\j\Sites\simple_cms>ruby -v
ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
C:\Users\j\Sites\simple_cms>mysql --version
mysql Ver 14.14 Distrib 5.5.21, for Win64 (x86)
I've already searched the web looking for solutions, but none of them
seem to work. Any help would be greatly appreciated, thank you.
The problem is that the .dll file required to run mysql2 is not available, and, as a result, it does not recognize it as a valid Win32 application.
Download the "mysql-connector-c-noinstall-6.0.2" from the official repository. You may be asked to register, but it's free. Go to downloads, select "MySQL Connectors => Connector/C (libmysql)".
Unzip the downloaded file, then copy "libmysql.dll", located in the lib folder, to your Ruby/bin folder.
I had similar issues once with my server on mac. I changed the version of ruby and it helped. Change the version of ruby to 1.8.7 and try if it works.

Getting errors when starting a rails server with MySQL on mac os

I've been tinkering with this one for several days and I still get the same error. For starters, I have been able to start a newly rails app with sqlite as the database but the application we are working on uses Mysql. So when I go to the app directory and type "rails server" it gives me the following:
/Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `require': dlopen(/Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `<top (required)>'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
from /Users/gojinjedi/Sites/bluey/config/application.rb:7:in `<top (required)>'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /Users/gojinjedi/.rvm/gems/ruby-1.9.2-p180#rails3/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
So (I think) MySQL development headers aren't installed, which I googled everywhere how to install them and tried most install command line to no success yet. Examples of commands I've tried:
gem install mysql2
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include
I did the bundle install, bundle update and bundle commands in the app directory...I'm running out of options...can you help me?
I'm on mac osx 10.7
have you tried something like this, I'm one Mac OS X (lion) too and I have no problem with the mysql gem. Or may be you can find what you want here
[EDIT]
Or you can simply use ruby-mysql gem for development environment

Problem with MySQL and Rails Server

Final edit: I played with a few different files got some more errors and then reinstalled rvm and everything else from the start, found a few fixes and edited them and finally everything works. thank you everyone for your help
Edit: I have noticed that it says Library not loaded: /usr/local/mysql-5.5.10-osx10.6-x86_64/lib/libmysqlclient.18.dylib (LoadError)
But I have mysql 5.5.11, how do I fix that?
I literally have searched for the past 3 hours, but found nothing that worked
Same error occurs when I either try to launch the server or generate a model
I have bundler and mysql2 gems.
builder (2.1.2)
bundler (1.0.12)
erubis (2.6.6)
i18n (0.5.0)
mail (2.2.17)
mime-types (1.16)
mysql2 (0.2.7)
I get the following output:
hrs772:demo kishinmanglani$ rails s
/Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `require': dlopen(/Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/mysql-5.5.10-osx10.6-x86_64/lib/libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.2.7/lib/mysql2.rb:8:in `<top (required)>'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `block in require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'
from /Users/kishinmanglani/rails_projects/demo/config/application.rb:7:in `<top (required)>'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
from /Users/kishinmanglani/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Whenever you get load errors you should make sure you have all of the dependencies installed and in place.
Make sure you have gem mysql2 in your Gemfile.
Install bundler if you don't already have it with gem install bundler.
Run bundle (same as bundle install).
Then try running the server again.
mysql2 with rails 3.0.3 is give some error so try to update rails version with 3.0.6
it working fine so try