Hello, I''ve failed to get Rails 3 to connect to MySQL and have read that the current MySQL ( which is MySQL2) doesn''t work with Rails 3. It isn''t clear to me, from looking at the primarily *nix instructions on the net, how to do this in Windows: settings in database.yml, gems to install, where to get a MySQL database that works and where to put it, etc. What are the proper steps? Thanks, Barney -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Chirag Singhal
2011-Jun-30 07:20 UTC
Re: Beginner''s question: Rails 3 and MySQL on Windows
Easiest way to get started with Rails on Windows is to use RailsInstaller - http://railsinstaller.org/ MySQL 5.1 has issues with Rails on windows, so better use MySQL 5.0, while installing either choose the option where mysql exe is added to path or copy libmysql.dll after installation to ruby''s bin folder. If this doesn''t work, then post the exact error you encounter and we will take it from there. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/fHaCAIioOysJ. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I have a post http://bit.ly/lNxcB1 where I did a clean install for rails 3 any MySQL. I am also using MySQL 5.1 on Win XP It is a pain to get it going on windows but once you do it run OK. Also on my blog I''ve posted a few gotcha''s I''ve had with windows and some gems. Hope it helps. John On Jun 30, 2:20 am, Chirag Singhal <chirag.sing...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Easiest way to get started with Rails on Windows is to use RailsInstaller -http://railsinstaller.org/ > > MySQL 5.1 has issues with Rails on windows, so better use MySQL 5.0, while > installing either choose the option where mysql exe is added to path or copy > libmysql.dll after installation to ruby''s bin folder. > > If this doesn''t work, then post the exact error you encounter and we will > take it from there.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
example yml setting development: adapter: mysql encoding: utf8 reconnect: false database: name_of_database pool: 5 username: agoodone password: secret socket: /tmp/mysql.sock I''ve always used mysql Gem> gem install mysqlJohn On Jun 30, 7:58 am, John Ivanoff <john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a posthttp://bit.ly/lNxcB1where I did a clean install for > rails 3 any MySQL. I am also using MySQL 5.1 on Win XP > It is a pain to get it going on windows but once you do it run OK. > Also on my blog I''ve posted a few gotcha''s I''ve had with windows and > some gems. > > Hope it helps. > > John > > On Jun 30, 2:20 am, Chirag Singhal <chirag.sing...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Easiest way to get started with Rails on Windows is to use RailsInstaller -http://railsinstaller.org/ > > > MySQL 5.1 has issues with Rails on windows, so better use MySQL 5.0, while > > installing either choose the option where mysql exe is added to path or copy > > libmysql.dll after installation to ruby''s bin folder. > > > If this doesn''t work, then post the exact error you encounter and we will > > take it from there.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Guys, Thanks for the replies, but I''m still stuck with "rake db:migrate" failing. I get a popup window that says that LIBMYSQL.DLL can''t be found and the command line says that c:/ruby192/lib/ruby/gems/ ruby 1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so can''t be found (the statement has the Windows slashes backward but I don''t know where that request is coming from in the code and I suspect that it doesn''t matter, anyway). Using the parameter "--trace" shows a lot of lines but none of them are marked as creating the error. I''ve installed MySQL 5.5.13 today from the MySQL.com community site but I have no evidence that that is being used. Any suggestions on what is stopping this progress would really be appreciated! Barney On Jun 30, 9:20 am, John Ivanoff <john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> example yml setting > > development: > adapter: mysql > encoding: utf8 > reconnect: false > database: name_of_database > pool: 5 > username: agoodone > password: secret > socket: /tmp/mysql.sock > > I''ve always used mysql Gem > > > gem install mysql > > John > > On Jun 30, 7:58 am, John Ivanoff <john.ivan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have a posthttp://bit.ly/lNxcB1whereI did a clean install for > > rails 3 any MySQL. I am also using MySQL 5.1 on Win XP > > It is a pain to get it going on windows but once you do it run OK. > > Also on my blog I''ve posted a few gotcha''s I''ve had with windows and > > some gems. > > > Hope it helps. > > > John > > > On Jun 30, 2:20 am, Chirag Singhal <chirag.sing...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Easiest way to get started with Rails on Windows is to use RailsInstaller -http://railsinstaller.org/ > > > > MySQL 5.1 has issues with Rails on windows, so better use MySQL 5.0, while > > > installing either choose the option where mysql exe is added to path or copy > > > libmysql.dll after installation to ruby''s bin folder. > > > > If this doesn''t work, then post the exact error you encounter and we will > > > take it from there.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Well, to use a former co-workers phrase, "I''ve been crawling over broken glass", trying everything and seemed to have found something that worked: 1) I downloaded and installed MySQL community edition 5.5.13, even though it isn''t on anyone''s recommended list and 2) installed a gem for mysql-2.8.1-x86-mingw32 which I saw recommended somewhere, then 3) modified John''s yml file from above to be: development: adapter: mysql encoding: Latin1 reconnect: false database: mysql pool: 5 timeout: 5000 username: a password: a and the line: rake db:migrate finally worked and made a table with the data I had in that file. Also, I could add a couple of records via the screen from http://localhost:3000/people so I think I can make progress from here. Thanks to John and Chirag for taking the time to point me in some good directions! Barney -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sorry, left out a step from the above: Get a dll: http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll and put it in c:\ruby192\bin with other dlls That''s before, of course, running: rake db:migrate in the ruby command line shell Barney -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jun 30, 2:54 pm, Barney <bsper...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Guys, > Thanks for the replies, but I''m still stuck with "rake > db:migrate" failing. I get a popup window that says that LIBMYSQL.DLL > can''t be found and the command line says that c:/ruby192/lib/ruby/gems/ > ruby 1.9.1/gems/mysql-2.8.1-x86-mingw32/lib/1.9/mysql_api.so can''t be > found (the statement has the Windows slashes backward but I don''t know > where that request is coming from in the code and I suspect that it > doesn''t matter, anyway). Using the parameter "--trace" shows a lot of > lines but none of them are marked as creating the error. I''ve > installed MySQL 5.5.13 today from the MySQL.com community site but I > have no evidence that that is being used.You need libmysql.dll from MySQL 5.0.x, which was used to build mysql gem binaries. Either you download that or you can force compilation of MySQL gem following these instructions (see MySQL/C Connector) https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#gems_mix_bits http://stackoverflow.com/questions/5367563/unable-to-install-mysql2-gem-on-windows-7/5368767#5368767 -- Luis Lavena -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.