title: rbenv and gemsets mismatch (?) causing Cucumber failures
body: <p>Last week, my Cucumber tests started failing. All of them. Here is the error: </p>
  
  <pre><code>undefined method `split_stylesheet_link_tag' for #&lt;#&lt;Class:0x007ff9a433c390&gt;:0x007ff9a6a848f8&gt; (ActionView::Template::Error)
  </code></pre>
  
  <p><code>split_stylesheet_link_tag</code> is a method I have from the <a href="https://github.com/zweilove/css_splitter" rel="nofollow">css_splitter gem</a>. It's found in my <code>application.html.haml</code> file. (Hence why all the tests are failing; they all use that main template.) Loading the view that the Cucumber test is trying to load works in development. In other words, this is only an issue in my test environment.</p>
  
  <p>Here's where it gets weird. I was using RVM, and I had concluded it was an issue with my gemsets, because it's the gem that exposes that method. So I switched to rbenv, and ran the tests. They worked.</p>
  
  <p>I'm not sure what I've changed in the meantime (I know, I know), but I'm getting that failure again. If you're interested in the backtrace, you can find it <a href="https://gist.github.com/thenickcox/eeb1deca0520b2cac57e" rel="nofollow">here</a>.</p>
  
  <h3>What I've Tried</h3>
  
  <p>Googling around caused me to check the contents of <code>.bundle/config</code>. It contains
  <code>BUNDLE_DISABLE_SHARED_GEMS: '1'</code>
  That sounded like something that could be a culprit, so I changed that to <code>0</code> and ran <code>bundle install</code>. It changed it back to <code>1</code>.</p>
  
  <p>One interesting thing is that when I run <code>bundle install</code> in the root of this Rails app, I get this message:
  <code>Your bundle is complete!
  It was installed into ./vendor/bundle</code></p>
  
  <p>This didn't seem right.</p>
  
  <p>I'm using <a href="https://github.com/jf/rbenv-gemset" rel="nofollow"><code>rbenv-gemset</code></a>. When I ran <code>cat .rbenv-gemsets</code>, I got <code>global</code>. So I followed the docs for <code>rbenv-gemsets</code> and changed <code>global</code> to <code>.gems</code>. The docs suggested that this would install the gems into the <code>.gems</code> directory in my project root. Running <code>bundle install</code> again gave me the same message about installing the gems into <code>./vendor/bundle</code>, and there isn't a <code>.gems</code> directory in the root of my project. (I had assumed that adding <code>.gems</code> would create one.)</p>
  
  <p>I'm using <code>tmux</code>, and wondering if that had something to do with it because of <a href="https://github.com/sstephenson/rbenv/issues/369" rel="nofollow">this issue</a>, I tried running the tests outside of <code>tmux</code> and got the same error.</p>
  
  <p>I've also made sure that my <code>.bash_profile</code> file contains <code>eval "$(rbenv init -)"</code> and that I've gone back through the <code>rbenv</code> setup. I've confirmed that both <code>rbenv</code> and its shims directory are on my path.</p>
  
  <p>I made sure that <code>css_splitter</code> is in my Gemfile and is not nested under a <code>group</code>.</p>
  
  <p>I'm sort of grasping at straws here. Just throw out any ideas.</p>