Try to figure out which mysql socket to use. Default to /path/to/your/mysql.sock
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2645 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
4c4651ad00
commit
6273753a42
@ -1,5 +1,8 @@
|
|||||||
*SVN*
|
*SVN*
|
||||||
|
|
||||||
|
* The rails command tries to deduce your MySQL socket by running `mysql_config
|
||||||
|
--socket`. If it fails, default to /path/to/your/mysql.sock
|
||||||
|
|
||||||
* Made the rails command use the application name for database names in the tailored database.yml file. Example: "rails ~/projects/blog" will use "blog_development" instead of "rails_development". [Florian Weber]
|
* Made the rails command use the application name for database names in the tailored database.yml file. Example: "rails ~/projects/blog" will use "blog_development" instead of "rails_development". [Florian Weber]
|
||||||
|
|
||||||
* Added Rails framework freezing tasks: freeze_gems (freeze to current gems), freeze_edge (freeze to Rails SVN trunk), unfreeze_rails (float with newest gems on system)
|
* Added Rails framework freezing tasks: freeze_gems (freeze to current gems), freeze_edge (freeze to Rails SVN trunk), unfreeze_rails (float with newest gems on system)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
development:
|
development:
|
||||||
adapter: mysql
|
adapter: mysql
|
||||||
database: <%= app_name %>_development
|
database: <%= app_name %>_development
|
||||||
host: localhost
|
socket: <%= socket %>
|
||||||
username: root
|
username: root
|
||||||
password:
|
password:
|
||||||
# With the MySQL adapter on localhost, it defaults to /tmp/mysql.sock
|
# With the MySQL adapter on localhost, it defaults to /tmp/mysql.sock
|
||||||
@ -13,13 +13,13 @@ development:
|
|||||||
test:
|
test:
|
||||||
adapter: mysql
|
adapter: mysql
|
||||||
database: <%= app_name %>_test
|
database: <%= app_name %>_test
|
||||||
host: localhost
|
socket: <%= socket %>
|
||||||
username: root
|
username: root
|
||||||
password:
|
password:
|
||||||
|
|
||||||
production:
|
production:
|
||||||
adapter: mysql
|
adapter: mysql
|
||||||
database: <%= app_name %>_production
|
database: <%= app_name %>_production
|
||||||
host: localhost
|
socket: <%= socket %>
|
||||||
username: root
|
username: root
|
||||||
password:
|
password:
|
||||||
|
@ -11,6 +11,8 @@ def initialize(runtime_args, runtime_options = {})
|
|||||||
super
|
super
|
||||||
usage if args.empty?
|
usage if args.empty?
|
||||||
@destination_root = args.shift
|
@destination_root = args.shift
|
||||||
|
@socket = `mysql_config --socket`.strip
|
||||||
|
@socket = '/path/to/your/mysql.sock' if @socket.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
def manifest
|
def manifest
|
||||||
@ -32,7 +34,10 @@ def manifest
|
|||||||
m.template "helpers/test_helper.rb", "test/test_helper.rb"
|
m.template "helpers/test_helper.rb", "test/test_helper.rb"
|
||||||
|
|
||||||
# database.yml and .htaccess
|
# database.yml and .htaccess
|
||||||
m.template "configs/database.yml", "config/database.yml", :assigns => { :app_name => File.basename(File.expand_path(@destination_root)) }
|
m.template "configs/database.yml", "config/database.yml", :assigns => {
|
||||||
|
:app_name => File.basename(File.expand_path(@destination_root)),
|
||||||
|
:socket => @socket
|
||||||
|
}
|
||||||
m.template "configs/routes.rb", "config/routes.rb"
|
m.template "configs/routes.rb", "config/routes.rb"
|
||||||
m.template "configs/apache.conf", "public/.htaccess"
|
m.template "configs/apache.conf", "public/.htaccess"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user