title: NameError: uninitialized constant GemName::Rails::Railtie
body: <p>I'm creating a gem to encapslate a chunk of functionality from an application. Them gem essentially runs a rake task, but when I run the task with <code>bundle exec rake:assets:precompile</code>, I get the following error</p>
  
  <pre><code>rake aborted!
  Bundler::GemRequireError: There was an error while trying to load the gem 'gem-name'.
  /Users/tonyedwardspz/myprojects/westcornwallevents/config/application.rb:8:in `&lt;top (required)&gt;'
  /Users/tonyedwardspz/myprojects/westcornwallevents/Rakefile:4:in `require'
  /Users/tonyedwardspz/myprojects/westcornwallevents/Rakefile:4:in `&lt;top (required)&gt;'
  NameError: uninitialized constant GemName::Rails::Railtie
  /Users/tonyedwardspz/myprojects/westcornwallevents/config/application.rb:8:in `&lt;top (required)&gt;'
  /Users/tonyedwardspz/myprojects/westcornwallevents/Rakefile:4:in `require'
  /Users/tonyedwardspz/myprojects/westcornwallevents/Rakefile:4:in `&lt;top (required)&gt;'
  </code></pre>
  
  <p>The code for the module related to railtie is:</p>
  
  <pre><code>require 'rails'
  
  module GemName
    module Rails
      class Railtie &lt; Rails::Railtie
        railtie_name :gem_name
  
        rake_tasks do
          load "tasks/gem_name.rake"
        end
      end
    end
  end
  </code></pre>
  
  <p>Any ideas why I'm getting this error?</p>