From 9601f96a70445e45428bb14ca069ccbca7a9c113 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Mon, 17 Oct 2005 23:19:48 +0000 Subject: attempt to fix #2500 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2669 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../rails_generator/generators/applications/app/app_generator.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'railties/lib/rails_generator/generators/applications/app/app_generator.rb') diff --git a/railties/lib/rails_generator/generators/applications/app/app_generator.rb b/railties/lib/rails_generator/generators/applications/app/app_generator.rb index dbb76c3e85..57979804fd 100644 --- a/railties/lib/rails_generator/generators/applications/app/app_generator.rb +++ b/railties/lib/rails_generator/generators/applications/app/app_generator.rb @@ -3,7 +3,7 @@ require 'rbconfig' class AppGenerator < Rails::Generator::Base DEFAULT_SHEBANG = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']) - + default_options :gem => true, :shebang => DEFAULT_SHEBANG mandatory_options :source => "#{File.dirname(__FILE__)}/../../../../.." @@ -11,7 +11,7 @@ class AppGenerator < Rails::Generator::Base super usage if args.empty? @destination_root = args.shift - @socket = `mysql_config --socket`.strip rescue nil + @socket = MYSQL_SOCKET_LOCATIONS.find {|f| File.exists?(f) } @socket = '/path/to/your/mysql.sock' if @socket.blank? end @@ -128,4 +128,9 @@ class AppGenerator < Rails::Generator::Base vendor vendor/plugins ) + + MYSQL_SOCKET_LOCATIONS = [ "/tmp/mysql.sock", #default + "/var/run/mysqld/mysqld.sock", #debian + "/var/tmp/mysql.sock", # freebsd + "/var/lib/mysql/mysql.sock" ] #fedora end -- cgit v1.2.3