Fixing gem error: undefined method `refresh’ for #<Hash:0x14f7c64>

February 10th, 2007

After upgrading to Gems 0.9.2 I got this error when I tried any gem command (except for gem list):

ERROR: While executing gem ... (NoMethodError) undefined method `refresh' for #<hash :0x14f7c64>

Deleting /usr/local/lib/ruby/gems/1.8/source_cache fixed this problem for me.

Notes from the RJS Peepcode Screencast

February 3rd, 2007

I recently finished watching the RJS Peepcode Screencast and boy does it kick butt. Here’s my notes from watching it:

  • simply helpful plugin generates dom ids based on object’s: @thing.dom_id – more info

  • use link_to_function + rjs in the view to generate js without an ajax call. example: link_to_function "Click Me", update_page {|page| page.alert "No postback!" }

  • call custom js functions with page.call page.call "my_func_name", param, anotherparam, etc

  • consider putting custom js functions that should be globally available in public/javascripts/application.js (this is included by javascript_include_tag :defaults)

  • page.select will fetch things by id or class page.select('#tasks div a').each do |item| page.hide item end

  • use a method name in a string var as a function call page.send 'method_name', param

  • replace/replace_html for outside/inside an element with page.replace_html page.replace_html 'task_totals', @task_totals

  • insert your own custom js into the page with < < page < < "my_js_method()"

    • or - page < < %( my_js_method(); function some_other_func() { ... } )
    • or - page < < render :partial => "update_totals"
  • assign js vars with values from ruby with page.assign page.assign 'task_totals', @task_totals

  • keep users informed of ajax calls during link_to_remote calls with :loading and :complete callbacks link_to_remote "Click Me", :url => tasks_url(:action => 'hello'), :loading => "Element.show('loading_div')", :complete => "Element.hide('loading_div')"

  • use rjs directly in the controller with render :update render :update do |page| page.alert('whatever') end

  • test rjs with ARTS

Of the iPhone and Supermodels

January 12th, 2007

Today at lunch, my co-workers and I were discussing the disappointing news from Apple that they won’t allow third-party apps to be installed on iPhone, to which I exclaimed:

Not allowing you to download software onto the iPhone is like having an untouchable supermodel living in your bedroom!

Yes, Laetitia Casta is still my favorite.

rails autotest error solved

June 24th, 2006

Long story short: I was getting some strange errors when trying to use autotest with a rails app that I’m working on.

Here’s the error I got:

[note: path edited...]/action_web_service/container/action_controller_container.rb:76:in `require_web_service_api’: neither _api or _api found (NameError) [... lots more output ...] /usr/local/lib/ruby/gems/1.8/gems/ZenTest-3.2.0/lib/unit_diff.rb:196:in `unit_diff’: undefined method `first’ for nil:NilClass (NoMethodError) from /usr/local/lib/ruby/gems/1.8/gems/ZenTest-3.2.0/lib/unit_diff.rb:84:in `unit_diff’ from /usr/local/lib/ruby/gems/1.8/gems/ZenTest-3.2.0/bin/unit_diff:38 from /usr/local/bin/unit_diff:18 # Test::Unit exited without a parseable failure or error message. # You probably have a syntax error in your code. # I’ll retry in 10 seconds

I managed to fix it by rebuilding my entire rails environment using the helpful instructions linked to from the rails site. Thanks Hivelogic!

I, for one, welcome our new Apple overlords

May 22nd, 2006

I was there at the opening of Apple’s new 5th Ave retail store. They recorded a timelapse video of all the poor blokes waiting in line (like me). And yes, because I’m so nerdy, I downloaded the movie and found the frames that Abel and I are captured in.

Behold: 1 2 3

Best. Editor. Ever.

April 29th, 2006

Look, if you’re on a Mac, and you do any sort of text editing (html, programming, whatever) and you’re not using Textmate, you SHOULD be. It’s worth the price, I promise. (And there’s a 30 day free trial anyway.) Just a friendly reminder. =-)

Birdsong

April 25th, 2006

OK, so I don’t have an unnatural ability to recognize natural bird sounds, but I did successfully recognize my first bird call the other weekend in the park, thanks to my Birding by Ear CDs! It was a White-throated Sparrow and it sounded pretty much exactly like the samples on the CDs. I’ve clearly got a long way to go, but it feels encouraging to know that I might have some potential at learning bird songs to help make me a better birder. I’m so old!

Thy Will Be Done

April 17th, 2006

Ok, update: I ordered a new gaming box, and I should have it by the end of the month. I can’t wait to play Half-Life 2!

To keep me busy until then, because it’s Spring and it’s driving me crazy that I can’t ID all the bird calls I’m hearing in the park, I’ve ordered Birding by Ear and it’s companion More Birding by Ear, which I should have in two days thanks to Amazon. Yes, I’m soo many different kinds of nerd it’s crazy, I know.

Anyone hear a pin drop?

April 6th, 2006

It’s been so quiet here lately (thanks to me just being off doing other things and not feeling in much of a blogging mood), and I feel kinda bad for the four readers of this blog (are any of you left?).

Current news is that my bitchass 6 year old PC died last weekend and I’ve been obsessing all week over what I should do about it. Currently leaning toward (read ‘drooling over’) getting a whole custom system. I really want to be able to play some of the pretty games that I couldn’t play on my old box (HalfLife2, Farcry, Doom3, Age of Empires 3, WoW with all the settings turned up, etc). Maybe I’ll go buy it today… ;-)

ETech 2006 Notes

March 7th, 2006

I’m posting all of the notes that I take, as well as any I can find shared by others via SubEthaEdit over at http://avantbard.com/docs/etech2006/.

So far, pretty fun.