Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
Standup 6/30/10 – Selenium blah blah blah RSpec focused test blah blah blah Rubymine blah blah

Help

  • Determining a users default time zone – someone must have solved this already, right? Well, Javascript only gives you the time offset, which isn’t that useful, but Fleegix has some good support we’ve used on other projects.
  • The after_commit gem – we wanted to create an audit entry every time a particular model failed to create successfully. We tried using the after_rollback hook in both our tests and our development environment but it just didn’t work. The before_rollback callback also didn’t work, but the non-rollback callbacks in the gem seemed to behave. Anyone have any thoughts outside of overriding ActiveRecord ourselves?

Interesting Things

  • Vows – real async Javascript testing for Node.js. Jasmine does support some async testing, but it sounds like it’s a bit clunky to do.
  • Using RVM on the server – is anybody doing this? Apparently not yet, but we had some strongly differing opinions on the matter as to how useful it would be and if it’s the right tool for the job. To be continued…
  • Rails 2.3.8 + mongrel_rails + Rack 1.1.0 – cookies do not work. At all. Apparently with Rack, cookies get fed into mongrel_rails as an array, while Mongrel expects them to be a String. Looks like someone already ran into this. The fix is to throw this in a Rails initializer file:

    class Mongrel::CGIWrapper
      def header_with_rails_fix(options = 'text/html')
        @head['cookie'] = options.delete('cookie').flatten.map { |v| v.sub(/^n/,'') } if options.class != String and options['cookie']
        header_without_rails_fix(options)
      end
      alias_method_chain(:header, :rails_fix)
    end if Rails.version == '2.3.8' and Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) and self.class.const_defined?(:Mongrel)
    

    (As an aside, running mongrel_rails by using script/server works fine, we only found this issue when running our Webrat Selenium tests, which calls mongrel_rails in some different way that causes this bug to be exposed.)

Comments
  1. bryanl says:

    I use RVM on the server. I actually think that it is the best fit. Of course things aren’t perfect, and you do have to set some environment variables to get it all. Maybe I should embrace the spirit of sharing, and fire off a blog post.

  2. I, like Brian, also use RVM on all of my servers and they do not have system rubies. In fact, RVM was written for my production deployments and hence all of my application servers (72) host one or more Ruby applications behind Nginx with proxy pass.

    We use one Linux user per project on each server. Each project user directory is then used for all deployments an the ‘current’ directory resides in the project user’s $HOME. Each user gets it’s own RVM installation which completely isolates changes to the Ruby / Gems environment that is dedicated to the project.

    This also allows for very easy ruby version / gem set migrations and rollbacks (we have been upgrading our projects to 1.9.2, we’ve had to backpedal once (ruby-odbc)).

    Monitoring (god) and other items that must run with root permissions are launched and controlled via rvmsudo and wrapper scripts.

    Darcy ( http://rubysoc.org/s-dlaycock ) and I have the next month of RVM development planned and part of that is to document our recommendations for deploying applications with RVM to server environments as well as easing deployments by contributing to various projects.

    ~Wayne

  3. My apologies Bryan for misspelling your name.

Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *