LoginSignup
2
6

More than 5 years have passed since last update.

RailsアプリからBootstrapを無効化する

Last updated at Posted at 2017-04-29

タイトル通りRailsアプリからBootstrap-sassを無効化する方法を残しておきます。
今までありそうでなかった。

Gemfileから削除

まず最初にGemfileからbootstrap-sassを削除します。

Gemfile
gem  'carrierwave'
gem 'rmagick'

gem 'jquery-ui-rails'
gem 'acts-as-taggable-on'
gem 'gon'

gem 'devise'
gem 'rails_admin'

gem 'kaminari'
gem 'ransack'

gem 'font-awesome-rails'
gem 'md_simple_editor'
gem 'redcarpet'
gem 'coderay'


gem 'therubyracer', platforms: :ruby
##↓を削除
gem 'bootstrap-sass'

次に

$bundle && gem uninstall bootstrap-sass

を実行します。

sassとjsファイルから削除

app/assets/stylesheets/application.scss

からbootstrap-sproketsとbootstrapを削除。

app/assets/stylesheets/application.js

からbootstrap-sprocketsを削除。

Gemfile.lockを削除

ここまできたらGemfile.lockを削除して

$bundle install

これで綺麗にbootstrapが取り外せる。
つける工程を考えれば逆のことをやっているだけなのだけれど、Gemfile.lockを消し忘れてはまった自分用に残しておきます。

2
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
6