News for hackers. Stuff that matters.
Re:Deploying a Rails 3.1 app in production by jarin on Friday May 27, 2011 @04:21AM (#2590808)
I couldn't post this in the Facebook comments on the post, but you can fix the Rake 0.9.0 error by putting the following right before load_tasks in your Rakefile:

    module ::MyAppName
      class Application
        include Rake::DSL
      end
    end

    module ::RakeFileUtils
      extend Rake::FileUtilsExt
    end
There's a fix on the way, too.

Also, I believe if you're using SASS/SCSS you can interpolate the asset like so, without having to use erb:

    background: #00ff00 url(#{asset_path 'rails.png'}) no-repeat fixed center;
Re:Deploying a Rails 3.1 app in production by getsat on Friday May 27, 2011 @06:48AM (#2591055)
Half my rake tasks in production will NOT work with this hack in place. I amended my similar comment.[1]

Rake 0.9.0 is extremely broken. I recommend reverting to 0.8.7.

[1] http://news.ycombinator.com/item?id=2572790

Re:Deploying a Rails 3.1 app in production by moomerman on Friday May 27, 2011 @04:35AM (#2590824)
Thanks for the info, I'll update the post shortly. Out of interest, what was wrong with the FB comments? I only started using it yesterday because disqus doesn't have a HTTPS option (that I could find anyway).
Re:Deploying a Rails 3.1 app in production by jarin on Friday May 27, 2011 @04:50AM (#2590859)
Oh, it seems to trip out on double colons. If I wasn't being lazy I would have just posted a gist.
Re:Deploying a Rails 3.1 app in production by moomerman on Friday May 27, 2011 @05:03AM (#2590887)
I just tried the SCSS trick but the generated CSS was:

    background: lime url(asset_path "rails.png") no-repeat fixed center;
Re:Deploying a Rails 3.1 app in production by jarin on Friday May 27, 2011 @05:12AM (#2590903)
Ah, yeah I forgot, that syntax is used for SassScript. I guess erb is the way to go then.
Re:Deploying a Rails 3.1 app in production by rabbitonrails on Friday May 27, 2011 @04:57AM (#2590873)
Thanks for the sass inline tip..dont know why i didnt think of that
Re:Deploying a Rails 3.1 app in production by rabbitonrails on Friday May 27, 2011 @05:04AM (#2590890)
also -- the DSL trick doesnt seem to work on heroku (?)..ive had to force 0.8.7 there