title: Custom library dependency to asset pipeline in rails?
body: <p>I'm deploying an application for the first time using Capistrano, and this is my first application in Rails 4 / Capistrano with a custom class in the lib folder.</p>
  
  <p>I receive the following error on deploy:</p>
  
  <pre><code>  * executing "cd -- /u/apps/focus/releases/20130917152233 &amp;&amp; RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile"
  servers: ["focus"]
  [focus] executing command
  *** [err :: focus] rake aborted!
  *** [err :: focus] cannot load such file -- VSphere
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `block in require'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require'
  *** [err :: focus] /u/apps/focus/releases/20130917152233/lib/tasks/usage.rake:3:in `block in &lt;top (required)&gt;'
  *** [err :: focus] /u/apps/focus/releases/20130917152233/lib/tasks/usage.rake:1:in `&lt;top (required)&gt;'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `block in load'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213:in `load_dependency'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222:in `load'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:641:in `block in run_tasks_blocks'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:641:in `each'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:641:in `run_tasks_blocks'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/railties-4.0.0/lib/rails/application.rb:244:in `run_tasks_blocks'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/railties-4.0.0/lib/rails/engine.rb:446:in `load_tasks'
  *** [err :: focus] /u/apps/focus/shared/bundle/ruby/1.9.1/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
  *** [err :: focus] /u/apps/focus/releases/20130917152233/Rakefile:6:in `&lt;top (required)&gt;'
  *** [err :: focus] (See full trace by running task with --trace)
  command finished in 4490ms
  *** [deploy:update_code] rolling back
  </code></pre>
  
  <p>I have a rake file, called usage.rake, that requires the VSphere library at the top of the task:</p>
  
  <pre><code>namespace :usage do
    desc "Tasks related to the usage application"
    require 'VSphere'
    ..snip..
  end
  </code></pre>
  
  <p>So I understand that my rake task is requiring the file, which works just fine when I run the rake task in development.</p>
  
  <p>So two questions:</p>
  
  <ol>
  <li><strong>Why</strong> is the asset pipeline is looking for the ruby library as a dependency? It doesn't fit as an "asset" in terms of Javascript or Stylesheet.</li>
  <li><strong>How</strong> do I get the pipeline to recognize this requirement isn't a gem and that the ruby file exists in the lib folder?</li>
  </ol>
  
  <p>Assumption Answer #1: I believe the asset pipeline is looking through the require statements of my rake task because it MAY contain javascript or stylesheets that it could precompile. In this case, it does not. I'm still looking for a way to avoid this 'dependency' or pointing the asset pipeline in the right direction of the custom library.</p>
  
  <p>Any guidance would be appreciated!
  Thanks!</p>
  
  <p><strong>Edit</strong>: Clarified two questions and removed confusion with other dependencies.</p>