Matthew Kocher's blog



Matthew KocherMatthew Kocher
Standup 12/17/09 - Rspec/Rack eats your cookies
edit Posted by Matthew Kocher on Thursday December 17, 2009 at 09:13AM

Interesting Things

  • The combination of Rspec and rack assume everything is a single domain, so you can't check cookies for xyz.foo.com and foo.com separately. Should you encounter this, be prepared to check the header manually. You also won't be able to delete more than one cookie at a time.

Matthew KocherMatthew Kocher
Standup 12/16/09
edit Posted by Matthew Kocher on Wednesday December 16, 2009 at 09:16AM

Ask for Help

  • "Does anyone know why directory globbing order differs by system architecture?" This problem bit this stand up blogger yesterday. An entire directory was required, and on a mac the order is alphabetical. On linux it's apparently random, most likely based on inode order. Ruby doesn't gaurantee an order, so something that may "just work" on a mac purely by luck might not work on linux/bsd/windows.
  • "Is anyone using unicorn on EngineYard?" Not yet.

Interesting Things

*Keep files continued - The keep file will cause the original file to be retained, so just touching the keep file is fine. No need to mess with sym links or anything of the sort

Matthew KocherMatthew Kocher
Standup 12/15/09 - Rubymine, Chef, Passenger and more
edit Posted by Matthew Kocher on Tuesday December 15, 2009 at 09:42AM

Ask for Help

"How do I get Rubymine to run Selenium tests?"

"sh: java command not found" - Tried setting environment variables in bash.rc. Rubymine doesn't use bash so it doesn't get the bash environment. You can set the variables in launchd.conf (be careful of the syntax), start Rubymine from the shell, or set the path in Rubymine.

It was brought up that Chef could be used to maintain these changes, and make it easy to spin up new developer workstations. It's agreed that it would be better than shell scripts, but unclear if it would be worth the effort.

Interesting Things

  • EngineYard, Chef, keep.appname.conf - appending keep will prevent chef from overwriting the file.
  • BufferedLogger flushes every 1,000 lines - It's buffered, after all. However, rails uses BufferedLogger by default in production, so when you switch to troubleshooting a a production issue, be aware. "Just poke it 1k times" was offered as a solution, but setting sync equal to true is probably easier.
  • Phusion Passenger/Facebooker/Threads Locals - All requests in passenger run in the same thread, which means the thread locals are shared. Facebooker is storing the facebook session in thread locals, which causes bad things to happen. This was difficult to debug as the team wasn't using passenger in development.

Interesting Things

  • Tweet this has some peculiarities which took some Pivots a while to figure out. The URL you want is http://twitter.com/home?status=this+is+my+tweet - Using www causes a redirect, and leaving off home appears to work, but will lose the message if the user is not currently logged in to twitter and has to go through the log in dialog.

  • A pivot asks if anyone uses the "tweet/share/digg/blog/sharethis/email/overshare" links. Two pivots do, one thinks they're "rarely used but requisite" and one has added them to a project recently and promises to report back in a few weeks with some log data.

Ask for Help

"Does anyone use Delayed Job with more than one worker process?"

One project is trying to use four workers, and can't find a way to monitor their individual status. The current solution is to spin them all down and then up, which not optimal. One suggestion is to wrap the entire thing in a rescue block, though this is probably not optimal.