Error: uninitialized constant Mysql::Protocol::UNIXSocket

/!\ FAILSAFE /!\ Wed Feb 03 23:02:50 +0500 2010
Status: 500 Internal Server Error
uninitialized constant Mysql::Protocol::UNIXSocket
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in
const_missing' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.2/lib/mysql/protocol.rb:212:ininitialize’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.2/lib/mysql/protocol.rb:209:in
initialize' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.2/lib/mysql.rb:110:innew’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.2/lib/mysql.rb:110:in
connect' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:585:inconnect’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:199:in
initialize' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:71:innew’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/mysql_adapter.rb:71:in
mysql_connection' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:innew_connection’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:245:in
checkout_new_connection' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:188:incheckout’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:in
loop' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:184:incheckout’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/monitor.rb:242:in mon_synchronize' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:183:incheckout’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:98:in
connection' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:326:inretrieve_connection’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:123:in
retrieve_connection' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:115:inconnection’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:9:in
cache' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/query_cache.rb:28:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:361:in
call' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/head.rb:9:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/methodoverride.rb:24:in
call' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/params_parser.rb:15:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/session/cookie_store.rb:93:in
call' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/failsafe.rb:26:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/lock.rb:11:in
call' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:114:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/reloader.rb:34:in
run' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/dispatcher.rb:108:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/static.rb:31:in
call' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:48:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:in
each' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/urlmap.rb:40:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/rack/log_tailer.rb:17:in
call' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:incall’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:50:in
service' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/httpserver.rb:104:inservice’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/httpserver.rb:65:in run' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/server.rb:173:instart_thread’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/server.rb:162:in start' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/server.rb:95:in start' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/server.rb:92:ineach’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/server.rb:92:in start' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/server.rb:23:instart’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/1.8/webrick/server.rb:82:in start' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:14:inrun’
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:111
C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:31:in
require' C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
script\server:3

Can someone faced this error before. I have just configured the
application until now.

It seems to me like that something is wrong with MySQL connection. But I
am not sure. Please help

On Wed, Feb 3, 2010 at 4:59 PM, Shahab Q.
[email protected] wrote:

Can someone faced this error before. I have just configured the
application until now.

It seems to me like that something is wrong with MySQL connection. But I
am not sure. Please help

It appears you’re running on Windows, which doesn’t have Unix sockets.
Sorry, I don’t know how to fix your problem.

It appears you’re running on Windows, which doesn’t have Unix sockets.
Sorry, I don’t know how to fix your problem.

On Windows, tell MySQL to connect to ‘127.0.0.1’ instead of
‘localhost’ to force the use of a TCP socket instead of unix sockets.

-Jonathan N.

On Wed, Feb 3, 2010 at 4:47 PM, Shahab Q.
[email protected] wrote:

/!\ FAILSAFE /!\ Â Wed Feb 03 23:02:50 +0500 2010
 Status: 500 Internal Server Error
 uninitialized constant Mysql::Protocol::UNIXSocket
  C:/Program Files/NetBeans
6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in
const_missing' Â Â C:/Program Files/NetBeans 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.2/lib/mysql/protocol.rb:212:ininitialize’

This looks like the ruby-mysql gem (which I assume is the pure-ruby
mysql driver) depends on UNIXSocket, which is obviously not available
on Windows.

Perhaps you’re using the default Rails configuration that tries to use
unix sockets instead of a real socket? Try changing the config to
specify a host name instead of a UNIX socket file.

  • Charlie

Hey, I’ve got the same issue, how do I set mysql to connect to
localhost:3001 in my case ??
Thanks!


frmsrcurl:
http://compgroups.net/comp.lang.ruby/Error-uninitialized-constant-Mysql-Protocol-UNIXSocket

On Mar 13, 6:23 pm, raronas [email protected] wrote:

Hello,
How do I do this?
MySQL works for other languages in my PC, for PHP for example, how do
I confgiure this with ruby on rails? in which config file?
thanks!

Please provide details about the ruby implementation and version
you’re using.

Also, the operating system and the version of mysql you’re trying to
connect with.

With that information, we can help you out figuring out which
component needs to be replaced and guide you on the right direction.

On 5 mar, 12:49, Charles Oliver N. [email protected] wrote:

This looks like the ruby-mysql gem (which I assume is the pure-ruby
mysql driver) depends on UNIXSocket, which is obviously not available
on Windows.

Perhaps you’re using the default Rails configuration that tries to use
unix sockets instead of a real socket? Try changing the config to
specify a host name instead of a UNIX socket file.

  • Charlie

Hello,
How do I do this?
MySQL works for other languages in my PC, for PHP for example, how do
I confgiure this with ruby on rails? in which config file?
thanks!

On 21 mar, 20:43, raronas [email protected] wrote:

thanks!

username: root
password: xxxxx
host: localhost

I’m using netbeans 6.8, I have Windows 7 Professional, Trying to use
MySQL 5.0,
have ruby 1.8.6 and rails 2.0.2.
Thanks!

Hello fellas!
Does anybody know something about this error? It’s really annoying I
can’t set it up correctly on my PC.
Thanks!!!

On 13 mar, 15:19, Luis L. [email protected] wrote:

Please provide details about the ruby implementation and version
you’re using.

Also, the operating system and the version of mysql you’re trying to
connect with.

With that information, we can help you out figuring out which
component needs to be replaced and guide you on the right direction.


Luis L.

Hello,
in database.yml I have this:

development:
adapter: mysql
encoding: utf8
database: dancemove_development
pool: 5
username: root
password: xxxxx
host: localhost

I’m using netbeans 6.8, I have Windows 7 Professional, Trying to use
MySQL 5.0,
have ruby 1.8.6 and rails 2.0.2.
Thanks!

On Sat, Mar 13, 2010 at 11:25 AM, raronas [email protected] wrote:

Hello,
How do I do this?
MySQL works for other languages in my PC, for PHP for example, how do
I confgiure this with ruby on rails? in which config file?
thanks!

It would be in your database.yml file.

  • Charlie

Hello fellas!
Does anybody know something about this error? It’s really annoying I
can’t set it up correctly on my PC.
Thanks!!!

Just a possibility, try changing ‘host’ from localhost to 127.0.0.1 so
it uses a TCPSocket instead of a UNIXSocket.

-Jonathan N.

I’m already Using 127.0.0.1.
Thanks anyway!


frmsrcurl:
http://compgroups.net/comp.lang.ruby/Error-uninitialized-constant-Mysql-Protocol-UNIXSocket

On Mar 29, 1:41 pm, raronas <[email protected]/> wrote:

I’m already Using 127.0.0.1.
Thanks anyway!

Please report to the ruby-mysql author[1] that this is a bug since is
not considering RbConfig::CONFIG[‘host_os’] to avoid usage of
UNIXSocket under Windows

[1] http://github.com/tmtm/ruby-mysql

On 29 mar, 09:03, Luis L. [email protected] wrote:


Luis L.

Hey, thank you all!
I’ve put 127.0.0.1 on host in database.yml and worked like a charm!
Thank you all guys! Problem Solved!

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