Olivier Db
2010-Aug-03 07:08 UTC
how to configure rails to use mysql by default (not sqlite3)
Hello, I am running Mac OS X 10.6.4 and have installed the following: ruby-1.9.1-p429 (64 bits, I believe!) RubyGems 1.3.7 Rails 2.3.8 MySQL 5.1.49 (64 bits) I am now getting an error because sqlite3 is not installed and I''ve read that there are issues installing ruby-sqlite3! SO I''m not sure if I should (or how to) install sqlite3. A developer suggested I use sqlite3 for testing and mysql for production, but wouldn''t that mean having to convert my sqlite database to mysql for production? I might just as well always use mysql, no? Which leads me to the following question: how do I configure rails to always default to using mysql database instead of sqlite3? Thank you for your help. Best regards, Olivier -- Posted via http://www.ruby-forum.com/. -- 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.
Kenneth
2010-Aug-03 10:07 UTC
Re: how to configure rails to use mysql by default (not sqlite3)
just add -d mysql option when you create a new rails project -- Posted via http://www.ruby-forum.com/. -- 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.
Marnen Laibow-Koser
2010-Aug-03 16:03 UTC
Re: how to configure rails to use mysql by default (not sqlite3)
Olivier Db wrote:> Hello, > > I am running Mac OS X 10.6.4 and have installed the following: > > ruby-1.9.1-p429 (64 bits, I believe!) > RubyGems 1.3.7 > Rails 2.3.8 > MySQL 5.1.49 (64 bits) > > I am now getting an error because sqlite3 is not installedSQLite comes with Mac OS. The OS uses it internally. No installation should be necessary, though you will probably have to install the sqlite3 gem.> and I''ve read > that there are issues installing ruby-sqlite3!Not to my knowledge.> SO I''m not sure if I > should (or how to) install sqlite3. > > A developer suggested I use sqlite3 for testing and mysql for > production, but wouldn''t that mean having to convert my sqlite database > to mysql for production?No. You have separate databases. You''ve also got migrations. No conversion is required.> I might just as well always use mysql, no?It depends. On the one hand, it''s extremely convenient and fast to use SQLite for testing and development. On the other hand, you may find that you would rather have the same DB in development as production. I''ve done it both ways. Both are fine. (And I would say you might as well *never* use MySQL. PostgreSQL is a much, much better DB.)> > Which leads me to the following question: how do I configure rails to > always default to using mysql database instead of sqlite3?-d mysql> > Thank you for your help. > > Best regards, > > OlivierBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.
Robert Walker
2010-Aug-04 02:41 UTC
Re: how to configure rails to use mysql by default (not sqlite3)
Marnen Laibow-Koser wrote:> Olivier Db wrote: >> Hello, >> >> I am running Mac OS X 10.6.4 and have installed the following: >> >> ruby-1.9.1-p429 (64 bits, I believe!) >> RubyGems 1.3.7 >> Rails 2.3.8 >> MySQL 5.1.49 (64 bits) >> >> I am now getting an error because sqlite3 is not installed > > SQLite comes with Mac OS. The OS uses it internally. No installation > should be necessary, though you will probably have to install the > sqlite3 gem.I''m not completely sure, but I don''t think SQLite is installed on Mac OS X unless Xcode developer tools are installed. However, many gems need the gcc compiler, which is also not installed until Xcode is installed. Conclusion... Install Xcode developer tools. The installed comes with Mac OS X. -- Posted via http://www.ruby-forum.com/. -- 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.
Marnen Laibow-Koser
2010-Aug-04 16:11 UTC
Re: how to configure rails to use mysql by default (not sqlite3)
Robert Walker wrote: [...]> I''m not completely sure, but I don''t think SQLite is installed on Mac OS > X unless Xcode developer tools are installed.I don''t have a Mac without developer tools handy to check, but I am 99% certain that you are wrong. SQLite is used by the operating system''s CoreData component, so it stands to reason that some form of SQLite is bundled into the OS regardless of developer tools. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.
Luis Gomez
2010-Aug-05 08:41 UTC
Re: how to configure rails to use mysql by default (not sqlite3)
Kenneth wrote:> just add -d mysql option when you create a new rails projectwhen i try to make rails -d mysql example or rails example -d mysql what i do get is to rails apps 1 called mysql and another called example. -- Posted via http://www.ruby-forum.com/. -- 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.
Luis Gomez
2010-Aug-05 09:00 UTC
Re: how to configure rails to use mysql by default (not sqlite3)
Luis Gomez wrote:> Kenneth wrote: >> just add -d mysql option when you create a new rails project > > when i try to make rails -d mysql example or rails example -d mysql what > i do get is to rails apps 1 called mysql and another called example.ok i know now ... i got to use the -D ( capital letter ) not the -d . -d is for documentations not for databases definition. -- Posted via http://www.ruby-forum.com/. -- 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.
Robert Walker
2010-Aug-05 15:10 UTC
Re: how to configure rails to use mysql by default (not sqlite3)
Marnen Laibow-Koser wrote:> I don''t have a Mac without developer tools handy to check, but I am 99% > certain that you are wrong. SQLite is used by the operating system''s > CoreData component, so it stands to reason that some form of SQLite is > bundled into the OS regardless of developer tools.You''re probably right about SQLite, but still the dev tools will likely be needed for compiling sqlite3-ruby native extensions. So whether SQLite is there or not without the dev tools is moot anyway. Still have to install the dev tools to use Rails effectively. -- Posted via http://www.ruby-forum.com/. -- 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.
Marnen Laibow-Koser
2010-Aug-05 15:21 UTC
Re: how to configure rails to use mysql by default (not sqlite3)
Robert Walker wrote:> Marnen Laibow-Koser wrote: >> I don''t have a Mac without developer tools handy to check, but I am 99% >> certain that you are wrong. SQLite is used by the operating system''s >> CoreData component, so it stands to reason that some form of SQLite is >> bundled into the OS regardless of developer tools. > > You''re probably right about SQLite, but still the dev tools will likely > be needed for compiling sqlite3-ruby native extensions. So whether > SQLite is there or not without the dev tools is moot anyway. Still have > to install the dev tools to use Rails effectively.Exactly. (Which is why I don''t have a Mac without dev tools handy... :) ) Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- 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.