SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Rookie RoR problem with ruby script/console...

    I installed Ruby, RubyGems, Rails, and MySQL on Tiger (Mac OS-X 10.4).

    All went well in Patrick Lenz' book on Rails, until the following error
    surfaced when I attempted to open a ruby console from the shovell
    directory within my home directory:

    MyComputer:~/shovell myname$ ruby script/console
    Loading development environment.
    /usr/lib/ruby/1.8/irb/completion.rb:10:in `require': No such file to load -- readline (LoadError)
    from /usr/lib/ruby/1.8/irb/completion.rb:10
    from /usr/lib/ruby/1.8/irb/init.rb:218:in `require'
    from /usr/lib/ruby/1.8/irb/init.rb:218:in `load_modules'
    from /usr/lib/ruby/1.8/irb/init.rb:216:in `each'
    from /usr/lib/ruby/1.8/irb/init.rb:216:in `load_modules'
    from /usr/lib/ruby/1.8/irb/init.rb:21:in `setup'
    from /usr/lib/ruby/1.8/irb.rb:54:in `start'
    from /usr/bin/irb:13

    Any fixes suggested, since I'm not at all experienced at reading and
    debugging using these kinds of Ruby error messages?

    Regards,
    Ambulance_driver

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to install readline. Here is a page that describes how to install Ruby + Rails + readline + some other things on your os:

    http://hivelogic.com/narrative/artic...ger?status=301

  3. #3
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My ex-boss wrote something about this on his blog at http://thelucid.com/articles/2007/03...x-the-easy-way

    I can't testify this as I now use Linux. It should work. OS X is a bit quirky in places which is one of irritations of using it compared to normal Linux
    http://virtualfunction.net - Rails Web Development
    http://squaremove.co.uk - Rails powered Property Listings

  4. #4
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Thank you for your suggestion that LINUX may pose fewer problems on install.

    I took the advice of Fenrir2 above, and used the installation instructions for
    Ruby, et.al., including MySQL, at:
    http://hivelogic.com/narrative/artic...ger?status=301

    The following problem scenario then transpired:

    A follow-up question. I, too, was unable to use mysql or mysql5 as a command at the UNIX prompt to connect to the server.

    However, when I attempt to use '/usr/local/mysql/bin/mysql', rather than connecting to the server, I receive the following ERROR 2002 message. I've given the
    command from Lenz' book to ensure that the server is running before I attempt to connect:

    Computer:~ myhome$ ps -ax | grep mysql
    38 ?? Ss 0:00.02 /opt/local/bin/daemondo --label=mysql5 --start-cmd /o
    75 ?? S 0:00.04 /bin/sh /opt/local/lib/mysql5/bin/mysqld_safe --datad
    99 ?? S 0:01.23 /opt/local/libexec/mysqld --basedir=/opt/local --data
    Computer:~ myhome$ /usr/local/mysql/bin/mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    Computer:~ myhome$

    Is there something I have to do to get a "mysql.sock" file that works?

    Appreciate in advance any guidance here.

    -Ambulance_driver

  5. #5
    Resident Java Hater
    Join Date
    Jul 2004
    Location
    Gerodieville Central, UK
    Posts
    446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The mysql.sock file in OS X is probably in some estrotic place. I tend to avoid socket connections and force connecting by a port by specifying a host (normally localhost if developing) and a port (typically 3306), and commenting out the socket. This a marginally slower, but it gets round the issue of locating the socket file which seems to vary wildly between POSIX based OS's.

    Alternativly you could try and use "locate mysql.sock" at the command line to find it. I think OS X has the locate command.
    http://virtualfunction.net - Rails Web Development
    http://squaremove.co.uk - Rails powered Property Listings

  6. #6
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb Missing this "mysql.sock" file entirely on my OS-X system...

    Interestingly enough,

    find / -name "mysql.sock" -print

    the above command revealed the absence of the requisite "mysql.sock" file
    when executing the above command as root on OS-X.

    Would anyone care to suggest how I might either construct this "mysql.sock" file (I can use
    the vi editor) or, perhaps, e-mail me a copy from their own mySQL-capable
    Mac running OS-X?

    I believe this might eliminate the current error I am having trying to connect to the mySQL server.

    Regards,
    Ambulance_driver


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •