Lazycoder

6Jul/050

getting Ruby on Rails working under Tiger

I’m not sure if the problem is due to Tiger or the mysql-2.6 gem package, but I know I wasn’t able to get it to compile on OS X Tiger 10.4. Here’s how I solved the problem I was having before.

First – download another MySQL api package from here. I grabbed the mysql-ruby-2.5.2.tar.gz archive since I wasn’t sure if the problem was 2.6 specific or if the 2.6.1 package would fix it.

Second – Unpack the archive in the appropriate gems directory. In my case it was /usr/lib/ruby/gems/1.8/gems/

Third – go into the directory where you unpacked the mysql-2.X archive that you downloaded and follow the instructions posted here. Here are the specific instructions.


sudo ruby extconf.rb --with-mysql-dir=/usr/local/mysql
sudo make
sudo make install

The ‘extconf.rb’ line tells ruby where to find the appropriate mysql libraries.

Filed under: General No Comments
6Jul/050

Bad things to hear from your DBA

It’s not good to hear your DBA ‘guru’ answer “Good question” when he’s been working for 2 months creating insert and update DTS packages for your application and you ask him “How can you tell if you are supposed to insert or update a given record in the source table?”.

Especially when NOT being able to tell the difference would result in over 500K duplicate inserts every day. (especially when the reason you’ve asked him that question is because you noticed his DTS package would result in the 500K dupe inserts/day).

grrrrrrrrrr

Filed under: Database, General No Comments
6Jul/056

Ruby on rails error

Well my Ruby on Rails experiment has come to a screeching stop. I’m going through the “ToDo” example, from their website and i’ve inserted the line “scaffold :todo” into my controller, but every time I try to run that page it throws up an error page that just says “bad handshake”. Now I know that someone it’s related to Ruby talking to MySql, but I can’t find anything on Google about it and there’s nothing in the log except a “500 error” listing. hmmmmmmmmm

update It would appear that MySQL changed it’s password hashing algorithm between version 4.0 and 4.1. Most of the Google hits said something to that effect, but they were talking about having just upgraded MySQL to 4.1 and the solution was to upgrade Rails. In my case I had the newest version of Rails, but I was running MySQL version 4.0. Since I’ve upgraded to 4.1 now, I’m getting a new error “no database selected”. The solution for that is to update your Ruby mysql api, but I can’t seem to get the gem updater to install the latest MySQL api for Ruby. hmmmm, back to the drawing board.

Building native extensions. This could take a while…
ERROR: While executing gem … (RuntimeError)
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.6 for inspection.
ruby extconf.rb install mysql\nchecking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… yes
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lsocket… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lnsl… no
checking for mysql_query() in -lmysqlclient… no

5Jul/053

A quick tip when dealing with resources

A quick tip, this may already be well known around the community, when dealing with .resx files and namspaces.

Make sure that the default namespace for your Visual Studio project is the same as the class you are trying to access resources embedded in your .resx files from. We kept running into problems if the two were not the same in one of our custom web controls. It appears that when .NET puts your resources into the manifest of your Assembly, it associates them with the default namespace of the project somehow. (I’m not entirely sure how this is all accomplished. I’ll see if either I or my co-worker can hunt down someone at MS who can give me a better explanation.).

The error you will get is long and generic, something about how the resource could not be retrieved for the given culture. I’ve just re-imaged my work machine, once I finish installing everything I’ll replicate the error and the solution, posting the code and error message here.

Filed under: .NET, C#, General, VB.NET 3 Comments
1Jul/050

Safari and RSS support

It’s interesting to note that if a web page presents two different types of feeds, RSS and ATOM, that when you click on the “RSS” badge in the address bar in safari it defaults to the ATOM feed. Even if the RSS feed is listed first in the HEAD section. At least on the few sites I’ve tried this on.

Filed under: General, MacOS No Comments