Rails4 and “undefined local variable or method `root_path'”

I recently started to mess around with Rails again and wanted to see what’s up with Rails4. I created my project using composer ( using bootstrap,haml,rails4 ) and created a simple scaffold.

When I fired up the rails server and tried to visit my scaffold page I got the following error: “undefined local variable or method `root_path'”. The error was in one of the layout templates where it referenced the root_path. I googled around a bit for the specific error with no luck. Then tried the search “rails4 root_path”. Seems like its no longer defined as a route by default. You have to do the following to get it to work:

  1. Open routes.rb
  2. add a route like the following
  3. root :to => "controller#action"

Hope this helps others!

How to get a Python Thrift client running on Mac OS

I was trying to get a Python Thrift client running on MacOS. All the stubs seemed to be missing a step of getting the actual Thrift lib installed.

Running my sample client I kept getting:

ImportError: No module named thrift.Thrift

To get around this you need the actual Thrift lib installed on your machine. I used this command ( note you might need to match your version of Thrift below ).

sudo easy_install thrift==0.9.0

Seemed to work out of the box for me after that.

NFS Client For Windows 7

I was trying to enable NFS on my windows 7 machine. Seems like only Ultimate and Professional have it available. Luckily I fit the bill. Here’s where to find and enable it:

This service is not installed by default and should not be installed on a “home” system. You can add or remove this service by heading to:

1. Head to Start
2. Select Control Panel
3. Select Programs
4. Select Programs and Features
5. Select Turn Windows Features on or off
6. Find the section “Services for NFS”

Default Path and Command Line Options

C:Windowssystem32nfsclnt.exe

Bizzare Foods w/ Andrew Zimmerman

Andrew Zimmerman Singapore

I was watching the travel channel “Andrew Zimmerman Bizarre Foods” episode the other day with some friends. There was a section on eating the chicken version of Rocky Mountain Oysters. I couldn’t believe the size of the organ compared to the size of the animal ( I forgot I was applying mammalian standards ). I went on a quest to find an anatomical diagram of a rooster somewhere on the web. I searched all over and finally found something. Sharing it here with everyone not that anyone else will every wonder about the same thing. Crazy that in our digital Google age finding something like this can be so hard.

http://animalsciences.missouri.edu/reprod/AnatomyMale/poultry/index.htm

File Dialog Popup EclipsePHP

Eclipse PHP was giving me fits. Every time I switched between tabs of files the file open/save dialog kept popping up. I tried to change file associations since I thought that was the problem but the issue remained.

I couldn’t find any posts on the web and then finally I found one. It said something about stopping Eclipse from doing previews. I searched through the options and couldn’t find anything right away. I finally followed:

Window (menu option) -> PHPEclipse Web Development -> “Browser Preview Default”.

Un-Check both of the options. After that the pop up went away.

Hope it works for someone else.

Michelin ’09 Released

And the rankings:

ONE STAR (*)

Acquerello — In SF
Ame — In SF
Auberge du Soleil
Bistro Jeanty
Bouchon
Boulevard — In SF
Chez Panisse
Chez TJ
Dining Room at the
Ritz-Carlton (The)
Farmhouse Inn & Restaurant
Fifth Floor — In SF
Fleur de Lys — In SF
Gary Danko — In SF
La Folie — In SF
Madrona Manor
Martini House
Masa’s — In SF
Murray Circle (new)
One Market — In SF
Plumed Horse (new)
Range — In SF
Redd
Terra
Trevese (new)
Village Pub (The) (new)

TWO STARS (**)

Aqua — In SF
Coi
Cyrus
Manresa
Meadowood, The Restaurant
Michael Mina — In SF

THREE STARS (***)

The French Laundry