Tag: osx

Ruby on Rails, Passenger & MySQL PATH issues in Snow Leopard

Posted by – September 8, 2009

I recently did a clean installation of Snow Leopard, which is great by the way, and I ran into some issues after installing MySQL and Ruby on Rails based on the instructions from Dan Benjamin at Hivelogic.

Specifically, when I would try to access a site in development mode I would get an error from Passenger that “Rails 2.3.4 could not be found”. I also noticed that on reboot my PATH wasn’t being loaded properly either so the system could not find MySql, Ruby, or RubyGems.

I tried placing the path information that, according to the instructions goes in ~/.profile into my ~/.bash_profile.

Now when I restart the system, MySQL and Ruby on Rail can be found! Passenger is working now as well. I am not sure if there was a change in the way Snow Leopard loads bash profiles or if there is just a problem with my installation that was preventing it from working when the PATH was specified in ~/.profile, but it’s all working now so hopefully this will help someone else.

Make OSX Terminal pretty

Posted by – August 31, 2009

I have always been annoyed with how a new tab opens in the OSX Terminal. I have my Terminal set to run “source ~/.bashrc” when the application starts. The problem with this is that it won’t run for new tabs, and I use lots of tabs (Rails development, web server, database, ruby console, etc…). And while I have been annoyed, it never really bothered me enough to look for a solution, until today.

As is usually the case, a quick search in Google led me to “Customizing the terminal prompt on Mac“. Apparently, OSX handles the terminal profiles a little differently than what I am used to. OSX uses profiles, where Ubuntu uses .bashrc. So, just add one line in your terminal profile to tell the terminal run the necessary command to load your .bashrc like so:

  1. First open up your ~/.bash_profile in your text editor of choice
  2. Add the line “source ~/.bashrc”
  3. Save and close ~/.bash_profile

Easy as can be! Now set your .bashrc to make your terminal as color-coded and informative as you want it to be. There are a lot of tutorials and information available for editing your .bashrc file.

Moving iTunes

Posted by – June 16, 2009

    I recently purchased a Drobo to move some of my larger multimedia files off of my iMac as it was running short on storage. The process for moving an iTunes library from one location to another can be daunting, so here are the steps I took. (Mac OSX specific).

    1. Copy files from drive A to drive B
    2. Make a backup of “iTunes Music Library.xml”
    3. Open “iTunes Music Library.xml” file on drive A in a text editor
    4. Find all references to drive A and replace with drive B
    5. Make a backup of the “iTunes Library” database file
    6. Delete the contents of the “iTunes Library” database file
    7. Open iTunes
    8. Get a beverage, it will take a while for iTunes to re-import your libraries xml file

    These steps were necessary because there are two accounts on my iMac using the same storage path for music but different iTunes libraries. Using the standard “Consolidate Library” method would have left me with thousands of duplicate song files. Using the above method simply changes where iTunes looks for the file to play.

Updating Ruby on OSX Leopard

Posted by – May 13, 2009

Quick and easy method for updating, or rather installing an updated version of Ruby on OSX Leopard (10.5) from Hivelogic. Ruby ships with OSX Leopard which is great, but the version included is outdated in regards to the recommendations of the Ruby on Rails folk.

This method seems to be the best way because it doesn’t overwrite what Apple has shipped with OSX, rather it just tells the computer to keep the older version, but use the newer version in it’s stead. Of course, this does require some command line shenanigans, but once you get started it really isn’t all that difficult. Besides, if you are concerned about using Ruby and/or Rails you should be comfortable using the command line!

Make Safari’s windows behave properly

Posted by – March 4, 2009

via: MacLife

I have not used Safari as my primary browser in OSX primarily because I prefer the tab behaviour of Firefox. This was true until I found this interesting article (See #4) on MacLife about changing the way Safari handles tabs.

Simply open up the Terminal and enter the following:

defaults write com.apple.Safari TargetedClicksCreateTabs -bool TRUE

This little gem tells Safari to open new windows in new tabs instead of in an entirely new window, just like Firefox does. Hopefully Apple will make this simpler in the future via an option in Safari’s Preferences, but until then I think this will suffice.

Now all I need Apple to do is to get auto-complete of URLs working like Firefox…

Secure Google Notifier

Posted by – July 15, 2007

Unbeknownst to most, your when you provide your user name and password to the Google Notifier for either Gmail or the Google Calendar you are transmitting those credentials in plain text. In order to secure your credentials, you need to configure the Google Notifier to transmit your credentials via secure http (https). To do, follow the directions in this article on macosxhints.com. I have discussed security in regards to Gmail before (see: “Secure your Gmail“), but that wasn’t necessarily in regards to the notifier.

While this may not seem all that important to you, just take a moment to consider how much of your personally identifiable information is transmitted through email. Without securing your credentials, you are inviting anyone to sniff your packets and pull any information that they want.

As far as I know, this little tip only works on the wonder-filled Mac OSX operating system.

Digital Nirvana

Posted by – November 1, 2006

As many of you know, I work in the IT field. The shop that I am in is all Microsoft, from the servers to the workstations. I recently became a Mac OSX convert as a result of my work with Ruby on Rails. I reached digital nirvana this evening when I was able to rather easily connect to my work’s network via our Cisco VPN and then remotely administer one of Windows servers using Microsoft’s Remote Desktop Connection for Mac OSX. This means that I don’t ever, ever, ever, ever need a Windows machine! Yay! (screenshot provided for the naysayers)

Screengrab