title: rails: backbone-on-rails gem-
body: <p>Trying to follow along with Ryan Bates Backbone.js tutorial to build a raffle application but i've already encountered problems with the first bit of code. In the init function of the application.js, he initialized the new instance of Raffler routes which is supposed to trigger the alert "Home Page" but I'm getting the following errors in Firebug that I don't understand</p>
  
  <pre><code>entries.js:5Uncaught ReferenceError: Raffler is not defined
  entry.js:15Uncaught ReferenceError: Backbone is not defined
  entries.js:23Uncaught ReferenceError: Backbone is not defined
  index.js:17Uncaught ReferenceError: Backbone is not defined
  application.js:7Uncaught SyntaxError: Invalid regular expression: missing /
  raffler.js:9Uncaught TypeError: undefined is not a function
  </code></pre>
  
  <p>Any ideas how I can fix this?</p>
  
  <p><strong>javascripts/raffler/application.js</strong></p>
  
  <pre><code>window.Raffler =
    Models: {}
    Collections: {}
    Views: {}
    Routers: {}
    init: -&gt; 
      new Raffler.Routers.Entries()
      Backbone.history.start()
  
  $(document).ready -&gt;
    Raffler.init()
  </code></pre>
  
  <p><strong>routers/entries.js</strong></p>
  
  <pre><code>class Raffler.Routers.Entries extends Backbone.Router
    routes:
      '': 'index'
  
    index: -&gt;
      alert "home page"
  </code></pre>
  
  <p>Update</p>
  
  <p>After I ran the generator <code>//= require_tree .</code> was immediately after the require jquery_ujs which, i discovered (I think) is what caused some of the problems. However, I've now moved it to the bottom and am still getting this error</p>
  
  <pre><code>Raffler.Routers.Entries is not a constructor
  [Break On This Error]   
  
  new Raffler.Routers.Entries();
  </code></pre>
  
  <p>Application.js</p>
  
  <pre><code>    //= require jquery
      //= require jquery_ujs
      //= require underscore
      //= require backbone
      //
      //= require .//raffler
      //
      //= require_tree ../templates/
      //= require_tree .//models
      //= require_tree .//collections
      //= require_tree .//views
      //= require_tree .//routers
      //= require_tree .
  </code></pre>