简体   繁体   English

带有Rails 4的twitter-bootstrap-rails 4.0.0

[英]twitter-bootstrap-rails 4.0.0 with Rails 4

https://github.com/seyhunak/twitter-bootstrap-rails says: Twitter Bootstrap for Rails 5 and Rails 4 Asset Pipeline https://github.com/seyhunak/twitter-bootstrap-rails说:Twitter Bootstrap for Rails 5和Rails 4资产管道

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? 是否可以使twitter-bootstrap-rails 4.0.0与Rails 4.1.7一起使用?

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 . 您用于twitter-bootstrap-rails4.0.04.0.0 rails >= 5.0.1, ~> 5.0有依赖性>= 5.0.1, ~> 5.0您可以在此处检查。

Use version 3.2.0 instead, it will work for you. 请改用版本3.2.0 ,它将为您工作。

gem "twitter-bootstrap-rails", '~> 3.2.0'
  • Cloned twitter-bootstrap-rails repo 克隆的twitter-bootstrap-rails回购
  • Analyzed latest commits 分析最新提交
  • Changed gemspecs 更改宝石规格
  • ???? ????
  • PROFIT!!! 利润!!!

I vote for using bootstrap 4 WITHOUT gem. 我投用引导4 宝石。

In some cases and my experiences, this kind of implementation need less work when we integrate it to Rails manually : 在某些情况下和我的经验中,当我们手动将其集成到Rails时,这种实现所需的工作更少:

  • download all the needed CSS, Java, creatives 下载所有需要的CSS,Java,广告素材
  • put them all in the proper Rails assets folder 将它们全部放在正确的Rails资产文件夹中
  • include them properly on the assets main file ( application.js, application.css, images ) 将它们正确包含在资产主文件中(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. 这样,您就不必担心宝石的依赖关系,甚至不必担心Ruby和Rails版本。

And totally welcoming any better ideas than mine. 并且完全欢迎任何比我更好的主意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM