Felipe Pieretti Umpierre
2012-Jan-22 22:17 UTC
Create new Rails with mysql default on database.yml
Hello, I''m trying to connect with a db in my app, but when I go on config/database.yml the default db is sqlite3, how can I put the mysql as default ? # SQLite version 3.x # gem install sqlite3 # # Ensure the SQLite 3 gem is defined in your Gemfile # gem ''sqlite3'' development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: sqlite3 database: db/test.sqlite3 pool: 5 timeout: 5000 production: adapter: sqlite3 database: db/production.sqlite3 pool: 5 timeout: 5000 Thanks -- 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.
Hassan Schroeder
2012-Jan-22 22:34 UTC
Re: Create new Rails with mysql default on database.yml
On Sun, Jan 22, 2012 at 2:17 PM, Felipe Pieretti Umpierre <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hello, I''m trying to connect with a db in my app, but when I go on > config/database.yml the default db is sqlite3, how can I put the mysql > as default ?`rails new --help` -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
Felipe Pieretti Umpierre
2012-Jan-22 22:41 UTC
Re: Create new Rails with mysql default on database.yml
felipe@Felipe:~/rails_projects$ rails new --help Usage: rails new APP_PATH [options] Options: -r, [--ruby=PATH] # Path to the Ruby binary of your choice # Default: /home/felipe/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL) -m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL) [--skip-gemfile] # Don''t create a Gemfile [--skip-bundle] # Don''t run bundle install -G, [--skip-git] # Skip Git ignores and keeps -O, [--skip-active-record] # Skip Active Record files -S, [--skip-sprockets] # Skip Sprockets files -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc) # Default: sqlite3 -j, [--javascript=JAVASCRIPT] # Preconfigure for selected JavaScript library # Default: jquery -J, [--skip-javascript] # Skip JavaScript files [--dev] # Setup the application with Gemfile pointing to your Rails checkout [--edge] # Setup the application with Gemfile pointing to Rails repository -T, [--skip-test-unit] # Skip Test::Unit files [--old-style-hash] # Force using old style hash (:foo => ''bar'') on Ruby >= 1.9 Runtime options: -f, [--force] # Overwrite files that already exist -p, [--pretend] # Run but do not make any changes -q, [--quiet] # Supress status output -s, [--skip] # Skip files that already exist Rails options: -h, [--help] # Show this help message and quit -v, [--version] # Show Rails version number and quit Description: The ''rails new'' command creates a new Rails application with a default directory structure and configuration at the path you specify. You can specify extra command-line arguments to be used every time ''rails new'' runs in the .railsrc configuration file in your home directory. Note that the arguments specified in the .railsrc file don''t affect the defaults values shown above in this help message. Example: rails new ~/Code/Ruby/weblog This generates a skeletal Rails installation in ~/Code/Ruby/weblog. See the README in the newly created application to get going. felipe@Felipe:~/rails_projects$ -- 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.
Hassan Schroeder
2012-Jan-22 23:06 UTC
Re: Re: Create new Rails with mysql default on database.yml
On Sun, Jan 22, 2012 at 2:41 PM, Felipe Pieretti Umpierre <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> felipe@Felipe:~/rails_projects$ rails new --help<snip/> No need to post the results -- they''re the same for everybody :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
Felipe Pieretti Umpierre
2012-Jan-23 01:16 UTC
Re: Create new Rails with mysql default on database.yml
Ok, but how I can make the mysql be default ? -- 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.
Hassan Schroeder
2012-Jan-23 01:32 UTC
Re: Re: Create new Rails with mysql default on database.yml
On Sun, Jan 22, 2012 at 5:16 PM, Felipe Pieretti Umpierre <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Ok, but how I can make the mysql be default ?Uh, well -- the reason I suggested running that command is that the answer is in the output. :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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.
Norm Scherer
2012-Jan-23 04:01 UTC
Re: Re: Create new Rails with mysql default on database.yml
On 01/22/2012 06:16 PM, Felipe Pieretti Umpierre wrote:> Ok, but how I can make the mysql be default ? >To make mysql the default when you run rails new you would have to modify the rails code somewhere (If you cannot figure out where on your own you should not try to modify it). To change the database driver used on this particular instance modify config/database.yml. Run rails new xx -d mysql to see what the values in that file should be. -- 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.
In 3.2 you can define .railsrc with custom command line options that will always apply to rails new Sent from my iPhone On Jan 22, 2012, at 8:01 PM, Norm Scherer <normscherer-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org> wrote:> On 01/22/2012 06:16 PM, Felipe Pieretti Umpierre wrote: >> >> Ok, but how I can make the mysql be default ? >> > To make mysql the default when you run rails new you would have to modify the rails code somewhere (If you cannot figure out where on your own you should not try to modify it). To change the database driver used on this particular instance modify config/database.yml. Run rails new xx -d mysql to see what the values in that file should be. > -- > 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.-- 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.
Peter Vandenabeele
2012-Jan-23 09:40 UTC
Re: Re: Create new Rails with mysql default on database.yml
On Mon, Jan 23, 2012 at 5:06 AM, Noel <wwydiywd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> In 3.2 you can define .railsrc with custom command line options that will > always apply to rails new >Wow, that''s great :-) $ cat ~/.railsrc --skip-bundle -T -d postgresql $ time rails new test_3_2 Using --skip-bundle -T -d postgresql from /home/peterv/.railsrc create ... real 0m0.134s user 0m0.108s sys 0m0.024s My special thanks to "7039def6 (Guillermo Iguaran " for this :-) Peter -- 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.
Felipe Pieretti Umpierre
2012-Jan-23 11:18 UTC
Re: Create new Rails with mysql default on database.yml
Ok, I create a new project with rails new new_project -d mysql, but it create as default database mysql2.. is correct ? # MySQL. Versions 4.1 and 5.0 are recommended. # # Install the MYSQL driver # gem install mysql2 # # Ensure the MySQL gem is defined in your Gemfile # gem ''mysql2'' # # And be sure to use new-style password hashing: # http://dev.mysql.com/doc/refman/5.0/en/old-client.html development: adapter: mysql2 encoding: utf8 reconnect: false database: simple_cms_development pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql2 encoding: utf8 reconnect: false database: simple_cms_test pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock production: adapter: mysql2 encoding: utf8 reconnect: false database: simple_cms_production pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock -- 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.
thiagocifani
2012-Jan-23 11:20 UTC
Re: Re: Create new Rails with mysql default on database.yml
Yep. You need to use mysql2 gem in a rails 3 project to avoid encoding problems! thx 2012/1/23 Felipe Pieretti Umpierre <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>> Ok, I create a new project with rails new new_project -d mysql, but it > create as default database mysql2.. is correct ? > > # MySQL. Versions 4.1 and 5.0 are recommended. > # > # Install the MYSQL driver > # gem install mysql2 > # > # Ensure the MySQL gem is defined in your Gemfile > # gem ''mysql2'' > # > # And be sure to use new-style password hashing: > # http://dev.mysql.com/doc/refman/5.0/en/old-client.html > development: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: simple_cms_development > pool: 5 > username: root > password: > socket: /var/run/mysqld/mysqld.sock > > # Warning: The database defined as "test" will be erased and > # re-generated from your development database when you run "rake". > # Do not set this db to the same as development or production. > test: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: simple_cms_test > pool: 5 > username: root > password: > socket: /var/run/mysqld/mysqld.sock > > production: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: simple_cms_production > pool: 5 > username: root > password: > socket: /var/run/mysqld/mysqld.sock > > -- > 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. > >-- thiagocifani http://thiagocifani.wordpress.com/ twitter.com/thiagocifani del.icio.us/thiagocifani <http://del.icio.us/thiagocifani> -- 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.