Technology

Mac Environment for OS X Yosemite

I updated to OS X Yosemite and as usual a lot of development things stopped working.  I figured it was time to get serious about Python as well, so here's how I'm setting things up.

brew

I use brew to put packages on Mac OSX.  I like it.  Its easy.  Unfortunately, with the update brew stopped working.  This is because of the new Ruby that is included with OS X.  I found the answer here: http://jcvangent.com/fixing-homebrew-os-x-10-10-yosemite/ Lifesaver!

brew packages

brew upgrade
That command does it all for me.

rdesktop

This part took the longest. This is how I access Windows Servers I have to work with.  When I updated rdesktop and I would launch the desktop, I got:
ERROR: Failed to open display: /private/tmp/com.apple.launchd.807sqNUiEV/org.macosforge.xquartz:0
Had to follow instructions here: http://stackoverflow.com/questions/26489928/cant-load-x11-in-r-after-os-x-yosemite-upgrade Then reboot.  That didn't work.  Next, I updated XQuartz.  This was done by opening XQuartz and then in the preference menu, check for updates and then update to the latest.  (2.7.7 in my case).  And guess what?  It hung forever.  So I had to go to Apple's site and download it: http://xquartz.macosforge.org/landing/ Then I extracted it and it worked fine.  Whew!

Environment

All this environment stuff needs some order.  I setup my bash_profile environment similar to this post: http://hackercodex.com/guide/mac-osx-mavericks-10.9-configuration/ and this post: http://hackercodex.com/guide/python-development-environment-on-mac-osx/ The resulting is that I now have Python installed and its coming from /usr/local/bin instead of the one supplied by Apple. pip install virtualenv From here I set up a directory called ~/VirtualEnvs as specified by the above referenced setup document.  Now all my projects for python can be done inside of virtual python environments with the command: virtualenv <myproject> So we are ready to role with that. Here is my ~/.bash_profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
#PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
# make my user installed binaries take precedence. 
#export ARCHFLAGS="-arch x86_64"
test -f ~/.bashrc && source ~/.bashrc
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/sbin:$PATH
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
and here is the .bashrc file
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
# require a virtual environment to install pip
export PIP_REQUIRE_VIRTUALENV=true
# so we don't have to redownload packages.
export PIP_DOWNLOAD_CACHE=$HOME/.pip/cache
# more info: http://hackercodex.com/guide/python-development-environment-on-mac-osx/
Hope that helps. And I'm open to nice suggestions.

Ruby on Rails Environment

I noticed my rails projects no longer worked after I opened Xcode and updated some components.  To solve this I found I needed to run:
xcode-select --install
I also ran
gem update
This command took about 45 minutes to run!  That didn't quite do the trick.  What really did it was my rvm environment got messed up.   We don't want brew to control ruby versions it turns out.  So I added back the rvm call in the .bash_profile (fixed above).  Then I ran rvm install 2.1 to install the 2.1 version of ruby.  I then did rvm default 2.1 and from now on, that ruby version pops up and I'm good.

Serial Console

With every update I have to update the driver for my USB to Serial cable.  I have an old one.  I found the instructions to upgrade here and it worked perfect.  The one change was the values I had to put in the plist: idProduct 8964 idVendor 1659 Before reading that I kept reinstalling the driver. Turns out just a quick modification of the /System/Library/Extensions/ProlificUsbSerial.kext/Contents/Info.plist was all it took.