Patch for selecting MySQL socket in app_generator.rb

Was trying out Streamlined and it was complaining about not finding
/tmp/mysql.sock. Traced the problem to the rails command. In
app_generator.rb, it is trying to find alternate paths for the socket
only when the OS is Windows. A simple change from = to ! fixed it.

http://dev.rubyonrails.org/svn/rails/trunk/railties/lib/rails_generator/generators/applications/app/app_generator.rb

*** old/app_generator.rb 2006-07-16 00:07:05.310476266 -0400
— new/app_generator.rb 2006-07-16 00:07:32.973448980 -0400
*************** class AppGenerator < Rails::Generator::B
*** 109,115 ****
end

  def mysql_socket_location

! RUBY_PLATFORM =~ /mswin32/ ? MYSQL_SOCKET_LOCATIONS.find { |f|
File.exists?(f) } : nil
end

— 109,115 ----
end

  def mysql_socket_location

! RUBY_PLATFORM !~ /mswin32/ ? MYSQL_SOCKET_LOCATIONS.find { |f|
File.exists?(f) } : nil
end

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs