uninitialized constant Jammit::Routes

This post is mostly just for me (because I know someday this is going to happen again and I'm going to search for this error string), but maybe somebody else will find it useful too. I just switched ruby environments and I couldn't run my rails project anymore, it failed with the error "uninitialized constant Jammit::Routes".

It routes.rb we've included the line "Jammit::Routes.draw(map)" for jammit routes, and that fails for some reason. Last time it took me forever to figure out why, but eventually I found that (for me, anyway) there was a problem with the closure-compiler-0.3.2 gem. It checks if you're on Windows and if so, it checks if you have ruby 1.9 installed or not. If you do it requires 'open3' and if you don't requires 'win32/open3'. I don't want to deal with all the mess of getting 'win32/open3' into our bundler bundle, and I don't actually need closure-compiler to work since I can't deploy from my box anyway, so I just changed the "lib/closure/popen.rb" file in the gem to not require 'win32/open3' and everything's happy again.


Unknown said…
Also works for people getting the "no such file to load error". Thanks for the helpful post. I was trying to download all sorts of open3 replacements and splice them in. Kind dumb that just removing it works! :-P

Popular Posts