Rails + MySQL + Snow Leopard

6 views
Skip to first unread message

Denny

unread,
Sep 13, 2009, 1:19:52 AM9/13/09
to Iowa City Ruby Group

Hi everyone,

I recently upgraded one of my Macs to 10.6.1, and I'm having trouble
getting a Rails apps going again. There are a couple of extenuating
circumstances, and I'm hoping you guys can help me figure out what's
going on. The application is running Rails 1.1.6. I didn't write the
app, and haven't had time to bring its stack up to date.

So here is what I've done:

- I upgraded my system. It went smoothly.
- Generally following this: http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard
- Installed 64-bit MySQL. I can successfully connect via client.
- Installed 64-bit mysql gem.

So the problem is with the mysql gem and the app. My app is running,
but any time a page tries to query the db an error is thrown.

The first weird thing I noticed is that I'm still running Ruby 1.8.6.
Everything I've read says Snow Leopard should bump the installation to
1.8.7. I'm pretty sure that's the system install. I don't remember
doing a custom build and there's nothing in /usr/local

progress:local dcrall$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1]

Then I noticed that the mysql gem v2.8 requires Ruby 1.8.7 or Ruby
1.9. So I downgraded to v2.7. Now I can query objects through script/
console, but the app still bombs.

So my current thought is one of two things. One, I need to upgrade to
Ruby 1.8.7. Two, is that the problem is with the older version of the
mysql ActiveRecord adapter. I suspect that I can connect through the
console because it's actually using Rails 2.3.3 and not the older
version under vendor.

Thoughts? Suggestions?




Paul Hinze

unread,
Sep 13, 2009, 10:38:06 AM9/13/09
to ic-...@googlegroups.com
On Sun, Sep 13, 2009 at 12:19 AM, Denny <dennis...@gmail.com> wrote:
> progress:local dcrall$ ruby -v
> ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.11.1]

Not only is that ruby 1.8.6, but that is 1.8.6p0... there were several
bugfix releases past that (I know we were at p286 for awhile).

Where is that ruby located? (What's the result of `which ruby`)

My guess is that if we focus on getting the ruby install to something
sane, everything else with fall into place.

-p

p.s. WindyCityRails was awesome ;)

Ransom Briggs

unread,
Sep 13, 2009, 11:32:10 AM9/13/09
to ic-...@googlegroups.com
phinze - care to post your uber script (setup_uiris_env) to github?
It would give denny too much mssql stuff but it would show how to get
started.

denny - 1.8.6 is broken w/ rails according to wycat

When you say the app bombs - what's the error (weird because you can
script console stuff)

Ransom

Denny

unread,
Sep 13, 2009, 3:06:34 PM9/13/09
to Iowa City Ruby Group
Thanks for the input guys. I'm glad Windy City Rails was good.

Okay, Paul, good call on the install. I had run "which ruby", but
obviously didn't look at the output carefully enough. I thought it was
the standard Apple install, but it was actually under /usr/local/bin.
I modified my PATH, and I do have 1.8.7 installed in /usr/bin.

Do you generally keep your own installation in something like /usr/
local? Is anyone using a tool to switch between different
installations?

I'll try and get my app running under 1.8.7. I'm worried Rails 1.1.6
is not going to be compatible, and I'll need to update the app. I
guess that's not such a bad thing except for the time suck.

Ransom - the error is something like "Wrong number of parameters for
MySQL something or other init". I think the console is using the
newest version of rails installed while the app runs against 1.1.6 in /
vendor.

I will say, the mysql gem needs better documentation. If you find
some, send it on.

Denny

Denny

unread,
Sep 13, 2009, 4:15:24 PM9/13/09
to Iowa City Ruby Group
Here's the actual error. I'm pretty convinced it's a version mismatch
with the old version of Rails I'm using. I'm going to try and install
an older version and see if I can get it to work.

ArgumentError (wrong number of arguments (1 for 0)):
/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:
551:in `initialize'
/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:
551:in `new'
/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:
551:in `scramble41'
/vendor/rails/activerecord/lib/active_record/vendor/mysql.rb:
141:in `real_connect'
/vendor/rails/activerecord/lib/active_record/connection_adapters/
mysql_adapter.rb:330:in `connect'
/vendor/rails/activerecord/lib/active_record/connection_adapters/
mysql_adapter.rb:87:in `initialize'
/vendor/rails/activerecord/lib/active_record/connection_adapters/
mysql_adapter.rb:36:in `new'
/vendor/rails/activerecord/lib/active_record/connection_adapters/
mysql_adapter.rb:36:in `mysql_connection'
/vendor/rails/activerecord/lib/active_record/connection_adapters/
abstract/connection_specification.rb:251:in `send'
/vendor/rails/activerecord/lib/active_record/connection_adapters/
abstract/connection_specification.rb:251:in
`connection_without_query_cache='
/vendor/rails/activerecord/lib/active_record/query_cache.rb:54:in
`connection='
/vendor/rails/activerecord/lib/active_record/connection_adapters/
abstract/connection_specification.rb:220:in `retrieve_connection'
...

Denny

unread,
Sep 14, 2009, 12:05:55 AM9/14/09
to Iowa City Ruby Group

With a bit of dumb luck, I stumbled upon: http://dev.rubyonrails.org/changeset/6328,
which allowed me to limp along under 1.1.6. I've started a branch to
upgrade to Rails 2, so hopefully I'll get that done.

Stupid question: What is the best way to uninstall the custom install
of Ruby 1.8.6 I have in /usr/local/bin?

Paul Hinze

unread,
Sep 14, 2009, 9:47:15 AM9/14/09
to ic-...@googlegroups.com
Denny <dennis...@gmail.com> on 2009-09-13 at 23:05:

> Stupid question: What is the best way to uninstall the custom install
> of Ruby 1.8.6 I have in /usr/local/bin?

Ruby unfortunately doesn't come with a `make uninstall` ... here's a
good overview of what you need to delete:

https://answers.launchpad.net/ubuntu/+question/65612

It's not a ton of stuff, luckily.

-p

Dennis Crall

unread,
Sep 14, 2009, 3:48:05 PM9/14/09
to ic-...@googlegroups.com

Cool. Thanks, Paul.

John Hughes

unread,
Sep 14, 2009, 4:07:01 PM9/14/09
to ic-...@googlegroups.com
Hi everyone,

I just recently joined this group.  I'm a non-traditional undergrad at the U of I studying computer science.  I'm new to ruby - using it for my Object Oriented class.

Denny, you asked about where people are keeping their own custom installations.  I found this
guide on hivelogic about using a usr/local directory to be very helpful:

http://hivelogic.com/articles/using_usr_local/

Macports is another program that adds a linux-like repository installation feature to your mac.  It looked to me like it also creates a directory for custom installs.  But that's about all I know about macports.

I look forward to meeting everyone sometime soon!

Cheers,
John Hughes
Reply all
Reply to author
Forward
0 new messages