avdgaag/nanoc-cachebuster — Issue #14: Cannot use nanoc-cachebuster with bundler
Author: agross
Created: 2012-02-19 11:16:00+00:00
State: open

I discovered bundler a couple of days ago and switched one of my nanoc projects over to it (I'm fairly new to Ruby development). I found that using nanoc-cachebuster with bundler somehow breaks nanoc's autoloading. From what I understand nanoc will automatically require helpers [once your access](https://github.com/ddfreyne/nanoc/blob/master/lib/nanoc/helpers.rb) their modules. I use some on nanoc's helpers which, when `include Nanoc::Helpers::Capturing` is invoked, fails with

```
NameError: uninitialized constant Nanoc::Helpers::Capturing
```

In my projects there are two methods of invoking nanoc:

* by running `bundle exec nanoc compile`
* by running `bundle exec rake`

The fun thing is that the first succeeds while the latter does not. `bundle exec rake` will at some point invoke nanoc's CLI with the compile flag (while doing work before and after that).

I've created [a reproduction](https://github.com/agross/nanoc-cachebuster-and-bundler) for you to look at. Tested on Windows and Ubuntu.

@ddfreyne Perhaps I'm using nanoc completely wrong in my rakefile.

Any hints would be greatly appreciated!