Skip to content

Instantly share code, notes, and snippets.

@frankie-loves-jesus
Created June 2, 2014 08:23
Show Gist options
  • Save frankie-loves-jesus/a404e4ee0e076bb5379a to your computer and use it in GitHub Desktop.
Save frankie-loves-jesus/a404e4ee0e076bb5379a to your computer and use it in GitHub Desktop.

Seems Half Pipe is looking for my assets in public/assets/styles and public/assets/scripts, which naturally 404s.

Here's what I did:

  • Installed grunt-cli:

      npm install grunt-cli -g
    
  • Added Half-Pipe to my Gemfile:

      gem 'half-pipe', github: 'd-i/half-pipe'
    
  • Installed Half-Pipe:

      bundle install
      rails g half_pipe:install
    
  • Installed Bower dependencies:

      bower install
    
  • Moved assets to new location:

      mv app/assets/javascripts/* app/scripts/
      mv app/assets/stylesheets/* app/styles/
      mkdir public/assets/
      mv app/assets/images/ public/assets/
      rm -rf app/assets
    
  • Replaced my CSS Sprockets directives with Sass imports

  • Wrapped the JS files referenced in application.html.erb in:

      'use strict'; define('myapp', [ ... ], function($) { ... }
    
  • Then I wrapped the JS files referenced in the define above in:

      define(['jquery'], function($) { ... });
    
  • Removed config.assets settings from config/application.rb

  • Manually added my libraries from bower_components to config/build.js

  • Started the server (no errors):

      grunt server
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment