As discussed in previous article, i have used railsinstaller which installed ruby, rails and sqlite3 but not mysql. So i had to install mysql separately. To use mysql database for my application, i modified the database.yml file to use mysql adapter and other required details.
Other thing to be noted is that you shoudl add the following line in your Gemfile
gem 'mysql'
You also need to ensure that you install the mysql gem using the following command
gem install mysql
Then i tried running the rake db:create command which failed showing up an error dialog with the error message as "The program cant start because LIBMYSQL.dll is missing from your computer. Try reinstalling the program to fix the problem.
Many bloggers have blogged that the above error will go away if we copy teh LIBMYSQL.dll from the mysql installation directory to the ruby/bin installation directory.
In my case, since i am using RailsInstaller, i copied to C:\RailsInstaller\Ruby1.8.7\bin
Then i tried rake db:create but i got the following exception
c:/RailsInstaller/Ruby1.8.7/lib/ruby/1.8/openssl/x509-internal.rb:77: [BUG] Segmentation fault
ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
But to overcome this error, i followed the tips from the following link
which had mentioned to copy the libmysql.dl from the svn repository location of instant rails website
This fixed my problem. Not sure about whats the reason though
No comments:
Post a Comment