diff options
author | Michael Koziarski <michael@koziarski.com> | 2005-10-17 23:19:48 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2005-10-17 23:19:48 +0000 |
commit | 9601f96a70445e45428bb14ca069ccbca7a9c113 (patch) | |
tree | 30287aa260688001a3f5fd4357eeed57b77ead59 /railties/lib/rails_generator/generators/applications/app | |
parent | 11cb22f0e66f5095f4d80ff279b9f36f2f5d395f (diff) | |
download | rails-9601f96a70445e45428bb14ca069ccbca7a9c113.tar.gz rails-9601f96a70445e45428bb14ca069ccbca7a9c113.tar.bz2 rails-9601f96a70445e45428bb14ca069ccbca7a9c113.zip |
attempt to fix #2500
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2669 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/generators/applications/app')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/app_generator.rb | 9 |
1 files changed, 7 insertions, 2 deletions
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 |