f



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: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/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:in
`new'
    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: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: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:in
`new'
    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:in
`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: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:in
`checkout'
    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:in
`checkout'
    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:in
`checkout'
    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: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: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: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/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:in
`call'
    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: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/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: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/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: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/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: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/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:in
`call'
    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: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: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:in
`call'
    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: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/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:in
`service'
    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:in
`start_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:in
`start_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:in `each'
    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:in `start'
    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:in
`run'
    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:in
`require'
    script\server:3
-- 
Posted via http://www.ruby-forum.com/.

0
2/3/2010 10:47:49 PM
comp.lang.ruby 48885 articles. 0 followers. Post Follow

14 Replies
1891 Views

Similar Articles

[PageSpeed] 58

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

-- 
Posted via http://www.ruby-forum.com/.

0
Shahab
2/3/2010 10:59:39 PM
On Wed, Feb 3, 2010 at 4:59 PM, Shahab Qadeer <shahab_qadeer@hotmail.com> 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.

0
Eric
2/4/2010 6:37:49 AM
> 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 Nielsen

0
Jonathan
2/4/2010 2:57:25 PM
Hey, I've got the same issue, how do I set mysql to connect to localhost:3001 in my case ??
Thanks!
0
Rodrigo
2/27/2010 3:54:54 PM
On Wed, Feb 3, 2010 at 4:47 PM, Shahab Qadeer <shahab_qadeer@hotmail.com> w=
rote:
> /!\ FAILSAFE /!\ =C2=A0Wed Feb 03 23:02:50 +0500 2010
> =C2=A0Status: 500 Internal Server Error
> =C2=A0uninitialized constant Mysql::Protocol::UNIXSocket
> =C2=A0 =C2=A0C:/Program Files/NetBeans
> 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/acti=
ve_support/dependencies.rb:105:in
> `const_missing'
> =C2=A0 =C2=A0C:/Program Files/NetBeans
> 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/ruby-mysql-2.9.2/lib/mysql/p=
rotocol.rb:212:in
> `initialize'

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

0
Charles
3/5/2010 3:49:24 PM
On 5 mar, 12:49, Charles Oliver Nutter <head...@headius.com> wrote:
> On Wed, Feb 3, 2010 at 4:47 PM, Shahab Qadeer <shahab_qad...@hotmail.com>=
 wrote:
> > /!\ FAILSAFE /!\ =A0Wed Feb 03 23:02:50 +0500 2010
> > =A0Status: 500 Internal Server Error
> > =A0uninitialized constant Mysql::Protocol::UNIXSocket
> > =A0 =A0C:/Program Files/NetBeans
> > 6.8/ruby2/jruby-1.4.0/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/ac=
tive_support/dependencies.rb:105:in
> > `const_missing'
> > =A0 =A0C:/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:in
> > `initialize'
>
> 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!
0
aronas23 (1)
3/13/2010 5:23:17 PM
On Mar 13, 6:23=A0pm, raronas <arona...@gmail.com> 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.

--
Luis Lavena
0
luislavena (644)
3/13/2010 6:19:05 PM
On Sat, Mar 13, 2010 at 11:25 AM, raronas <aronas23@gmail.com> 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

0
headius (200)
3/15/2010 6:55:50 PM
On 13 mar, 15:19, Luis Lavena <luislav...@gmail.com> wrote:
> On Mar 13, 6:23=A0pm, raronas <arona...@gmail.com> 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.
>
> --
> Luis Lavena

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!
0
raronas
3/21/2010 11:43:54 PM
On 21 mar, 20:43, raronas <arona...@gmail.com> wrote:
> On 13 mar, 15:19, Luis Lavena <luislav...@gmail.com> wrote:
>
>
>
> > On Mar 13, 6:23=A0pm, raronas <arona...@gmail.com> 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.
>
> > --
> > Luis Lavena
>
> Hello,
> in database.yml I have this:
>
> development:
> =A0 adapter: mysql
> =A0 encoding: utf8
> =A0 database: dancemove_development
> =A0 pool: 5
> =A0 username: root
> =A0 password: xxxxx
> =A0 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!!!
0
raronas
3/28/2010 11:48:36 PM
>
> 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 Nielsen

0
Jonathan
3/29/2010 5:25:51 AM
I'm already Using 127.0.0.1.
Thanks anyway!
0
raronas
3/29/2010 11:41:16 AM
On Mar 29, 1:41=A0pm, raronas <u...@compgroups.net/> 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

--
Luis Lavena
0
Luis
3/29/2010 12:03:07 PM
On 29 mar, 09:03, Luis Lavena <luislav...@gmail.com> wrote:
> On Mar 29, 1:41=A0pm, raronas <u...@compgroups.net/> 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
>
> --
> Luis Lavena

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!
0
raronas
4/1/2010 2:14:49 AM
Reply:

Similar Artilces:

Ruby Paypal library uninitialized constant error
I'm trying to use the paypal library for ruby but im getting an error on the ipn callback method. im getting the error: NameError (uninitialized constant Paypal::Notification::Money): /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:477:in `const_missing' I think it originates at this line of code: logger.info("paypal amount=#{notify.amount.to_s}") I have setup the helpers in the ApplicationHelper require 'paypal' module ApplicationHelper include Paypal::Helpers Has anybody else had this problem? Thanks, James -- Posted v...

Ruby - mysql
On Windows XP Prof system, using Ruby 1.8.4 & mysql-ruby-2.7.1 (pure ruby interface), myswl 5.0 server, and rubyuser is defined as a mysql user, I am trying to run the following sample program and getting the error: *** C:/ruby/lib/ruby/1.8/mysql.rb:453:in `read': Client does not support authentication protocol requested by server; consider upgrading MySQL client (Mysql::Error) from C:/ruby/lib/ruby/1.8/mysql.rb:130:in `real_connect' from C:/ruby/lib/ruby/1.8/mysql.rb:91:in `initialize' from C:/0-dwn/mysql/ruby-mysql-0.2.6/sampledb0.rb:5 I am able to perform all of t...

ruby - rexml/streamlistner
Using ruby 1.8.4-17_rc2, example from Enterprise Integration with ruby page 109: #Generates the followwing error: uninitialized constant Would someone look at this example and annotate what is wrong, Thank you, John ====================test-xml2.rb============================== require 'rexml/streamlistener' class ParcelHistoryListener include StreamListener def tag_name puts tag_name end end Document.parse_stream( File.new('parcel.xml'), ParcelHistoryListener.new ) ================= parcel.xml ============================= <?xml version=&quo...

uninitialized constant Test error when running Fitnisse ruby
has anyone seen this error before? I have no idea on how to fix I have all but exhausted myself looking for the solutions to this uninitialized constant Test C:/Documents and Settings/asingh/Desktop/QA/oriontests/orion_login.rb:1:in `' C:/Ruby/Ruby1.9/lib/ruby/gems/1.9.1/gems/fit-1.2/lib/fit/fixture_loader.rb:65:in `require' C:/Ruby/Ruby1.9/lib/ruby/gems/1.9.1/gems/fit-1.2/lib/fit/fixture_loader.rb:65:in `require_file' C:/Ruby/Ruby1.9/lib/ruby/gems/1.9.1/gems/fit-1.2/lib/fit/fixture_loader.rb:41:in `block in find_class' C:/Ruby/Ruby1.9/lib/ruby/ge...

mysql-ruby or ruby-mysql?
We're currently using: Apache 2.0.46 mod_ruby 1.20 Ruby 1.8.x (stable snapshot) Mysql 4.0.20 Do you recommend mysql-ruby or ruby-mysql? And what version would be most reliable given our setup? Based on the history log of mysql-ruby, we're not sure if it is compatible with Mysql 4.0 because it mentions 4.1. Thanks! Randy Lawrence wrote: > We're currently using: > > Apache 2.0.46 > mod_ruby 1.20 > Ruby 1.8.x (stable snapshot) > Mysql 4.0.20 > > Do you recommend mysql-ruby or ruby-mysql? And what version would be > most reliable given our setup? ...

mysql-ruby installation
Hi all, I am trying to install mysql-ruby-2.4.4 on my Fedora Core 3 with ruby 1.8.2 (2004-12-25) [i686-linux] (gcc (GCC) 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)). Following the instructions at http://tmtm.org/en/mysql/ruby/ I got the following scenario: [mark@localhost mysql-ruby-2.4.4]$ ruby extconf.rb checking for mysql_query() in -lmysqlclient... yes checking for mysql.h... no checking for mysql/mysql.h... yes creating Makefile extconf.rb:33: uninitialized constant CPP (NameError) As you can see I get the error at line 33. Looking at that line I see the assignment: cpp = Config::expand sprin...

ruby mysql error
Hi All, I'm trying to run mysql DB with ROR app. I'm using Netbeans 6.5 and whenever I run the server and it tried to hit the DB, I get the error: *** C:/InstantRails-2.0-win/ruby/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:38: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ***** Any thoughts Thanks in advance Maged -- Posted via http://www.ruby-forum.co...

uninitialized constant error
Hello all, I have a few models: class Collection < ActiveRecord::Base has_many :collection_images has_many :images, :through => :collection_images, :order => "id desc" end class CollectionImage < ActiveRecord::Base belongs_to :image belongs_to :collection end class Image < Resource has_many :collection_images has_many :collections, :through => :collection_images end .... which seems to be the typical "has_many through" situation. Now where my error occurs is when I call something like this from the controller: @images = Image.f...

Newb
I am a Newbie who has written some Ruby code - it actually works when 'all in one file'. To make it more re-usable and practice good coding style, I broke it into 2 - one for classes, one for test code. Call them 'Textractor.rb' and 'main.rb'. I've accepted that it is a simple error, but I can't track it down. I am posting so someone who has not stared at the code as long as I have may see right away what is evading me. I am working out of the 'Pickaxe' book, first edition, as a reference. I tried Google-ing the error message, but no dice. I als...

Errors in mysql + ruby connection
Hi folks - After getting my installation worked out, I'm having an error in my test code that I just don't understand. I am running on OS X (PowerPC). Ruby 1.8.4 mySQL 5.0.27 I'm using DBI to access the database, borrowing code from the Ruby Cookbook. The connection routine: #################################################################### dbconnect.rb: #################################################################### #!/usr/bin/ruby -w require 'rubygems' require 'dbi' def with_db DBI.connect("DBI:Mysql:iskme_import:localhost", "ISK...

error: ...uninitialized constant Wxruby2
I have already installed the wx package with ruby gem: gem install wxruby and now I am trying to run a gui sample program. As follow: require 'wx' include Wx class MyFrame < Frame def initialize() super(nil, -1, 'My Frame Title') @my_panel = Panel.new(self) @my_label = StaticText.new(@my_panel, -1, 'My Label Text', DEFAULT_POSITION, DEFAULT_SIZE, ALIGN_CENTER) @my_textbox = TextCtrl.new(@my_panel, -1, 'Default Textbox Value') @my_combo = ComboBox.new(@my_panel, -1, 'Default Combo Text', DEFAULT_POSITION, DEFAULT_SIZE, ['Item 1...

uninitialized constant error #2
I have three ruby classes, see below: 1. base_cls.rb File.dirname(__FILE__)+'/cls_factory' class BaseCls def self.say ClsFactory.say end end BaseCls.say 2. sub_cls.rb require File.dirname(__FILE__)+'/base_cls' class SubCls < BaseCls end 3. cls_factory.rb require File.dirname(__FILE__)+'/sub_cls' class ClsFactory def self.get_cls SubCls.new end end When I run base_cls.rb, I got this error: base_cls.rb:5:in `say': uninitialized constant BaseCls::ClsFactory (NameError) I don't understand why this error happens? Can anyone help me on ...

new to ruby: uninitialized constant
I have a program the simulates the knights tour problem. I made 2 classes, 1 called 'Location' which simulates a location on a chess board and one called 'KnightsTour' which actually performs the knights tour. Then I have a main.rb file which just creats a knights tour object (KnightsTour.new) and calls a method on that object. But whenever i try to run it, I get the following error: C:\NetBeansWorkspace\KnightsTour\lib\main.rb:3:in `const_missing': uninitialized constant KnightsTour (NameError) from C:\NetBeansWorkspace\KnightsTour\lib\main.rb:8 Any help would ...

mysql-ruby module errors
Im trying to install mysql-ruby on windows 2000. I thought version 2.7.1 installed properly even when I got a failed installation of 2.7.0 the command I used was "gem install mysql". That seemed to work perfectly so I ran a mysql-ruby test program from http://www.kitebird.com/articles/ruby-mysql.html. I was thrown this ruby error. Does this mean that Mysql.2.7.1 didnt install properly either? >ruby simple.rb C:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.1-mswin32/ext/mysql.so: 126: The specified module could not be found. -c:/ruby/lib/ruby/gems/1.8/gems/mysql-2.7.1-mswin32/ext/...

Web resources about - Error: uninitialized constant Mysql::Protocol::UNIXSocket - comp.lang.ruby

Resources last updated: 2/8/2016 3:32:37 AM