{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/74521667bd5af10263b15897950d52f3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"74521667bd5af10263b15897950d52f3","url":"https://api.github.com/users/robert-stuttaford","login":"robert-stuttaford","id":699012},"updated_at":"2011-10-30T16:21:48Z","labels":[],"assignee":null,"comments":3,"closed_at":null,"url":"https://api.github.com/repos/dturnbull/closure-script/issues/12","body":"So I did the following:\r\n\r\n    # config.ru\r\n    use Closure::Middleware\r\n\r\n    # Gemfile\r\n    gem 'closure'\r\n\r\n    #config/environments/development.rb\r\n    Closure.add_source '.', '/'\r\n    Closure.add_source :soy, '/soy'\r\n    Closure.add_source :docs, '/docs'\r\n\r\nAnd then set up a controller with one action, compiler:\r\n\r\n    def compiler\r\n      @query_string = ''\r\n      @query_string = 'build' if params['build']\r\n      @query_string = 'debug' if params['debug']\r\n    end\r\n\r\nAnd then I dropped in the compiler.js.erb, renaming 'query_string' to '@query_string'.\r\n\r\nTha's as far as I got. Now, I get:\r\n\r\n    undefined local variable or method `goog' for #<#<Class:0x0000012c813698>:0x0000012c80c7f8>\r\n\r\nWhat do I need to do next? :-)","html_url":"https://github.com/dturnbull/closure-script/issues/12","title":"Rails 3.1 Setup","number":12,"id":2090820,"created_at":"2011-10-30T15:01:06Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/7321934b88ca8da079d7b89926501a9c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"7321934b88ca8da079d7b89926501a9c","url":"https://api.github.com/users/dturnbull","login":"dturnbull","id":40563},"updated_at":"2011-10-30T16:21:48Z","url":"https://api.github.com/repos/dturnbull/closure-script/issues/comments/2570175","body":"It seems you have mounted the root of your rails app to be served at the root of your server.  Is this what you want?\r\n\r\nThe wiki suggests a different approach for Rails:\r\n\r\nhttps://github.com/dturnbull/closure-script/wiki/Rails-3-Setup\r\n\r\nPut the Scripts in app so you don't serve your Ruby source code.\r\n\r\n    Closure.add_source 'app/javascripts', '/myjs'\r\n\r\nI see you have add_source in development.rb so you can ignore my advice about checking Rails.env (unless you want to be doubly safe).  GitHub quoting made your paste look like one file, which is perfectly valid syntax for Script.\r\n","id":2570175,"created_at":"2011-10-30T16:21:48Z"}}