The Artima Developer Community
Sponsored Link

Java Buzz Forum
Running Rails on OS X with MySQL 5.0.24

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paul Kilroy

Posts: 58
Nickname: paulkilroy
Registered: Jul, 2004

Paul Kilroy is a Frustrated Programmer
Running Rails on OS X with MySQL 5.0.24 Posted: Sep 26, 2006 6:29 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Paul Kilroy.
Original Post: Running Rails on OS X with MySQL 5.0.24
Feed Title: The Frustrated Programmer
Feed URL: http://liberty.phpwebhosting.com/404.html
Feed Description: The problems I encounter on a daily basis, blogged for posterity. All content will be original, contain poor grammar and a few mispellings.
Latest Java Buzz Posts
Latest Java Buzz Posts by Paul Kilroy
Latest Posts From The Frustrated Programmer

Advertisement
While installing all the pre-requisites for running Rails on my new Mac Pro, I ran across a problem with either the mysql gem or mysql 5.0.24 where it depends on 'ulong' being defined by the OS include files. On OS X it isn't, and this causes the ruby mysql gem to fail compilation which causes Rails to (possibly) throw a Lost Connection to MySQL Server during query error due to the fact that the built-inc.parse('this tuesday 5:00', :ambiguous_time_range => :none) #=> Tue Aug 29 05:00:00 PDT 2006 Chronic.parse('may 27th', :now => Time.local(2000, 1, 1)) #=> Sat May 27 12:00:00 PDT 2000 Chronic.parse('may 27th', :guess => false) #=> Sun May 27 00:00:00 PDT 2007..Mon May 28 00:00:00 PDT 2007 The thing I find really nice is that if you pass it a malformed date, it returns nil. This means, in your model validations, you can add:
require 'chronic'

class Meeting < ActiveRecord::Base

  def validation
    errors.add :meeting_date, 'is not a valid date' if Chronic.parse(meeting_date.to_s).nil?
  end

end

Read: Running Rails on OS X with MySQL 5.0.24

Topic: Flickr: Pixel-art IBM Ad Previous Topic   Next Topic Topic: Animating layouts part II - a real application

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use