Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker
Ken Mayer

rails 3.0.2 + jasmine 1.0.1.1 + json_pure == dll_hell.rb

Ken Mayer
Tuesday, November 23, 2010

The 3.0.2 update to rails made a change in active support that creates an interference pattern failure in the jasmine-gem. Not jasmine, itself, mind you, just the standalone server that runs the jasmine tests, and not the server, but just the report runner. Thus, your tests are all green, but the jasmine suite fails anyway. You might see this error:

undefined method `merge' for #<JSON::Pure::Generator::State:0x102181890> (NoMethodError)

The selenium driver inside the jasmine gem is loadingjson_pureunless it can find an already loaded JSON class. json_pure was hacked by rails for other reasons, but it breaks JSON.generate. Madness ensues.

To fix this, you need to use something other than json_pure, at least in your test suite. The fix, fortunately, is pretty simple. Add the following line to your Gemfile

gem "json", "1.4.6"

This will load the json gem built with native extensions. The version number is not necessary to fix this problem, but we try to lock down versions as a standard practice.

This was maddeningly painful to pinpoint. I’m not sure if there’s a long term solution to the problem either. You need a JSON library, but so do many others. Monkey patching the class seems really handy, but is prone to break behaviors.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Abhijit Hiremagalur

Standup 08/04/2010: Accounting on Rails anybody?

Abhijit Hiremagalur
Wednesday, August 4, 2010

Ask for Help

  • Double-entry/ledger based accounting in Rails (i.e. Quickbooks in Rails for free)

Ideally would be tied in with user/role system where each accounting entry would be tied to a user, but also reconciled against a master account.

Recommendations? Latest and greatest?

One suggestion was to look at the code that Wesabe open sourced code when they closed their doors.

  • Error message when opening Rubymine “Invalid Git Root”

This is likely because the project included a submodule that wasn’t configured correctly, fix this in under Rubymine’s version control preferences.

Add submodule screen in Rubymine

Interesting Things

  • Test 404 handling (e.g. rescue_from ActiveRecord::RecordNotFound, :with => :render_record_not_found) with Cucumber by temporarily setting ActionController::Base.allow_rescue = true. This is usually set to false in features/support/env.rb
  • JSON.pretty_generate hates Rails 3 Hashes

 

  • Use window.postMessage to communicate between IFrames in a standard way

This should work in most modern browsers. Follow the Mozilla docs, NOT the various blog posts about this.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 3/24/2009: Browser History with Javascript and Page Based Json

Pivotal Labs
Tuesday, March 24, 2009

Interesting Things

  • Browser History with Javascript and Page Based Json: One of our projects solved the vexing problem of browser history for a page that has initial page provided json with subsequent ajax updates. A simple page back operation will display the originally downloaded data, not the updated data. The solution is to add a unique id for each page, and store these ids in a cookie. When an ajax request updates the page it removes its page id from the cookie. When you use the back button, each page checks to see if its unique id is in the cookie, and if it is not, it forces a reload.
    Really Simple History was mentioned as another way to manage javascript/ajax history.
  • Rubymine Build 784 has the Weirdest. Bug. Ever.: This may only be a problem if you work on a mac and you need to enter capital letters in rubymine dialogs like find and replace ;-). Many of us are fans of intellij/rubymine, but we wish they had a better test process. To be fair, rubymine is in public preview, so expect the occasional bug or two.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (781)
  • rails (113)
  • testing (88)
  • ruby (83)
  • ruby on rails (70)
  • jobs (62)
  • javascript (55)
  • techtalk (44)
  • rspec (38)
  • ironblogger (32)
  • productivity (30)
  • activerecord (29)
  • gogaruco (29)
  • git (28)
  • nyc (27)
  • rubymine (26)
  • bloggerdome (23)
  • mobile (22)
  • process (21)
  • pivotal tracker (21)
  • cucumber (20)
  • design (19)
  • jasmine (19)
  • ios (18)
  • webos (17)
  • objective-c (17)
  • android (16)
  • tracker ecosystem (16)
  • palm (16)
  • "soft" ware (16)
  • fun (15)
  • ci (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • bdd (14)
  • gem (13)
  • css (13)
  • tdd (13)
  • selenium (12)
  • goruco (12)
  • bundler (12)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
  • mojo (10)
  • chef (10)
  • api (10)
Subscribe to json Feed
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >