Created
January 23, 2017 02:14
-
-
Save JessCodes/b24f0fc647df3cef52177192cbb35907 to your computer and use it in GitHub Desktop.
Rails, Bower, Materialize, Heroku in 10 Steps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rails, Bower, Materialize, Heroku | |
1. To install Bower, you need to have to have node, npm, and git installed. Then run ``` npm install -g bower ``` | |
2. Create a bower.json file and add: | |
``` | |
{ | |
"name": "personal-website", | |
"dependencies": { | |
"jquery": "latest", | |
"materialize": "latest", | |
"d3": "latest", | |
"underscore": "latest" | |
} | |
} | |
``` | |
3. In .bowerrc: | |
``` | |
{ | |
"directory": "vendor/assets/components" | |
} | |
``` | |
4. Run ``` bower install ``` | |
5. In the class application of config/application.rb: | |
``` | |
config.assets.paths << Rails.root.join('vendor', 'assets', 'components') | |
``` | |
6. In Gemfile include: ``` gem 'materialize-sass' ``` | |
7. In app/assets/javascripts/application.js (add dependencies to your asset manifest files): | |
``` | |
//= require jquery | |
//= require jquery_ujs | |
//= require turbolinks | |
//= require_tree . | |
//= require materialize | |
// | |
// Bower packages | |
//= require d3 | |
//= require underscore | |
// | |
``` | |
8. In app/assets/stylesheets/application.css (add dependencies to your asset manifest files): | |
``` | |
*= require materialize | |
``` | |
9. In a .gitignore, include: | |
``` | |
/vendor/assets/components/* | |
``` | |
10. Deploy to Heroku! | |
``` | |
heroku create <app-name> | |
git push heroku master (or 'git push heroku <branch-name>-master) | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment