miravol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Nov-05 04:06 UTC
How to get rails command to default to MySQL instead of SQLite?
I''m running OS/X 10.5 Leopard. Although I have MySQL installed the rails command creates a database.yml file that defaults to SQLite. How do I get it to default to MySQL instead? TIA --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Brian Hogan
2007-Nov-05 04:27 UTC
Re: How to get rails command to default to MySQL instead of SQLite?
Hmmm. The Rails default is actually mysql. I haven''t looked at what they changed in 10.5 as I am still running my own build of Ruby and Rails. You can force the db type though. rails my_new_app --database=mysql On 11/4/07, miravol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <miravol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I''m running OS/X 10.5 Leopard. Although I have MySQL installed the > rails command creates a database.yml file that defaults to SQLite. How > do I get it to default to MySQL instead? > > TIA > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
William Pratt
2007-Nov-05 04:34 UTC
Re: How to get rails command to default to MySQL instead of SQLite?
Hmm, sure enough: #the pre-installed rails: macbookpro: wpratt$ /usr/bin/rails ... snip ... -d, --database=name Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3). Default: sqlite3 #and from my own stack: macbookpro: wpratt$ /usr/local/bin/rails ... snip ... -d, --database=name Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3). Default: mysql I guess this makes sense since Leopard doesn''t ship with mysql but does ship with sqlite3. -Bill On Nov 4, 2007, at 8:06 PM, miravol-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > I''m running OS/X 10.5 Leopard. Although I have MySQL installed the > rails command creates a database.yml file that defaults to SQLite. How > do I get it to default to MySQL instead? > > TIA > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gmlk
2007-Nov-05 07:48 UTC
Re: How to get rails command to default to MySQL instead of SQLite?
On Nov 5, 5:06 am, "mira...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <mira...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m running OS/X 10.5 Leopard. Although I have MySQL installed the > rails command creates a database.yml file that defaults to SQLite. How > do I get it to default to MySQL instead? > > TIAThe quick&dirty way is to edit /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ gems/1.8/gems/rails-1.2.3/lib/rails_generator/generators/applications/ app/app_generator.rb on lines 9 and 104 (replace sqlite3 with mysql) Or you could install rails version 1.2.5; which defaults again to mysql. Rails 1.2.5 is then installed in /Library/Ruby/Gems/1.8/gems/ rails-1.2.5/ Personally I like sqlite3 as the default and would like to know how to tell gem to use this as the default. Setting the shell variable RAILS_DEFAULT_DATABASE doesn''t seem to work. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---