twitter-bootstrap-rails 4.0.0 with Rails 4

436 views Asked by At

https://github.com/seyhunak/twitter-bootstrap-rails says: Twitter Bootstrap for Rails 5 and Rails 4 Asset Pipeline

but after bundle install I see this:

Bundler could not find compatible versions for gem "actionpack":
  In Gemfile:
    rails (= 4.1.7) was resolved to 4.1.7, which depends on
      actionpack (= 4.1.7)

    twitter-bootstrap-rails (~> 4.0.0) was resolved to 4.0.0, which depends on
      actionpack (>= 5.0.1, ~> 5.0)

Is it possible to make twitter-bootstrap-rails 4.0.0 worked with Rails 4.1.7?

3

There are 3 answers

0
Alex Jhonson On BEST ANSWER
  • Cloned twitter-bootstrap-rails repo
  • Analyzed latest commits
  • Changed gemspecs
  • ????
  • PROFIT!!!
1
Nitin On

Version you are using for twitter-bootstrap-rails is 4.0.0 having dependency on rails >= 5.0.1, ~> 5.0 you can check here.

Use version 3.2.0 instead, it will work for you.

gem "twitter-bootstrap-rails", '~> 3.2.0'
2
Fiqi Fitransyah On

I vote for using bootstrap 4 WITHOUT gem.

In some cases and my experiences, this kind of implementation need less work when we integrate it to Rails manually :

  • download all the needed CSS, Java, creatives
  • put them all in the proper Rails assets folder
  • include them properly on the assets main file ( application.js, application.css, images )
  • use it by following the proper guide from the bootstrap website
  • have a desired looks as you wish

This way, you won't have to worries about gem dependencies or even ruby and rails versions.

And totally welcoming any better ideas than mine.