Rails script/performance/request needed a little help

While following another great Ryan Bates Railscast, I had a couple of problems on my Ubuntu 8.04 development machine:

  • Rails 2.1.0′s ActionController wants version 0.6.1 or later of the ruby-prof gem, but the usual gem repositories only have 0.6.0 now. I found suggestions to install Jeremy Kemper’s fork on Github, but though I’d added GitHub as a gem source, installing jeremy-ruby-prof didn’t work because that installed his version with that name, which didn’t help ActionController. What worked was:
    sudo gem uninstall jeremy-ruby-prof # be sure to uninstall old attempts!
    git clone git://github.com/jeremy/ruby-prof.git
    cd ruby-prof
    rake gem
    sudo gem install pkg/ruby-prof-0.6.1.gem
    
  • Then, script/performance/request ran, but generated several strange error messages instead of producing results:
    Couldnt get a file descriptor referring to the console
    Could not get a file descriptor referring to the console
    Couldnt get a file descriptor referring to the console
    Could not get a file descriptor referring to the console
    

    This turned out to be because script/performance/request wants to use ‘open’ to open its output files (a text file and an HTML document), but on Ubuntu, /usr/bin/open is a link to /usr/bin/openvt, which didn’t do what we want (and generated those error messages). I’m not sure what else uses ‘open’, but this did the right thing: it lets Firefox open the files:

    sudo ln -sf /usr/bin/firefox /usr/bin/open

2 thoughts on “Rails script/performance/request needed a little help

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>