rake aborted: no such file to load mysql September 24, 2009
Posted by Puneet Pandey in Ruby On Rails.Tags: Could not find RubyGem rake-compiler (~> 0.5), mysql gem on windows, Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB, no such file to load mysql, rake aborted: no such file to load mysql, ruby-compiler, ruby-mysql, rubygems, The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql, trouble installing mysql gem on windows
trackback
Programmers who work mostly on windows have seen this kind of errors many times.. as a windows programmer I have been through many sites and collect d relevant data, now I am showing it to you..
The errors which might come to you something like this:
no such file to load mysql
rake aborted: no such file to load mysql
The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql
Could not find RubyGem rake-compiler (~> 0.5)
To solve such problems follow these steps:
Step 1. Update rubygems to the latest version(like I upgraded it to 1.3.5).
Step 2: install rake-compiler(by gem install rake-compiler).
Step 3: if already installed hoe gem update it(gem update hoe) or install a fresh one.
Step 4: Download libMySQL.dll from here and copy it into C:/ruby/bin or wherever your ruby is installed, but make sure it should be in bin directory.
Step 5: Stop the mysql service, from Control Panel -> Administrative tools -> services -> mysql, and then restart it.
That’s it. You are done, after all these steps you can try
rake db:migrate
Suppose if that doesn’t work then after 4th step, stop the mysql service and restart your system.
I welcome all of you to post your comments, feedbacks, queries
Cheers!!
Puneet Pandey

hi
i did what you say i am reciving this message when i do rake db:migrate
how can i fix this
rake aborted!
no such file to load –sqlite3
see full trace by runing task with –trace
each time i try to run my application i recive the avove mesge then when i ignore it i put ruby script/server
i open just hte first page then errors
All you need to do is to install sqlite3 gem by typing:
gem install sqlite3 in command prompt. and you are getting this error coz your application has sqlite3 settings stored in config/database.yml
If you want to use mysql then make sure whenever you are creating new applications it should have mysql database like:
rails my_app –database=mysql
In Your case all you need to do is to change the database.yml file like this:
development:
adapter: mysql
encoding: utf8
reconnect: false
database: your_database_name
pool: 5
username: root
password: your_mysql_pwd
save it and restart your server. It should run, if you have mysql installed and its gem ‘mysql’
Let me know if it works
Cheers
Puneet Pandey
Hi
thank you so much
but still not working when i put gem install sqlite3 recive message says:
ruby.exe:no such file to load –ubygems
i tried in my other computer also recive diffrent message says:
ERROR: could not find gem sqlite3 locally or in a repository.
also i want to aske you about these steps cuz i have my sql in one of my computer:
development:
adapter: mysql
encoding: utf8
reconnect: false
database: your_database_name
pool: 5
username: root
password: your_mysql_pwd
do not know where i supose to go to put these
iam beginer in ruby in rails
thank you
I suggest you to download and read some pdf’s on ruby on rails.. your approach is wrong.. you’ve started programming directly which is wrong.. there are online tutorials, books which has some demo rails application.. google it and try it, It will guide you through all the steps…