in controller you define:
@closepost
while in view you are calling:
@closeposts
and you call .each
on a variable that is not defined.
update
irb> a=Geokit::Geocoders::GoogleGeocoder.geocode '140 Market St, San Francisco, CA'
irb> a.ll
=> 37.79363,-122.396116
@closeposts = Post.within(5, :origin => @city.ll).order('distance DESC')
with geocode
@closeposts = Post.near('dublin', 50, :order => :distance)
You missed the distance parameter