Gemfile
gem 'therubyracer'
gem 'less-rails'
gem 'twitter-bootstrap-rails'
1. 公式サイトからBootstrap3のファイルをダウンロード
2. fontsディレクトリごとvendor/assets/fontsにコピー
3. config/application.rbにassetパスを追加
config/application.rb
class Application < Rails::Application
config.assets.paths << "#{Rails}/vendor/assets/fonts"
end
4. CSSファイルに下記を追加
app/assets/stylesheets/application.css
@font-face {
font-family: 'Glyphicons Halflings';
src: url('/assets/glyphicons-halflings-regular.eot');
src: url('/assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('/assets/glyphicons-halflings-regular.woff') format('woff'), url('/assets/glyphicons-halflings-regular.ttf') format('truetype'), url('/assets/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}
5. herokuで使えるようにするためにプリコンパイルする
config/intiarazers/assets.rb
Rails.application.config.assets.precompile += %w( *.woff *.eot *.svg *.ttf )
参考