Ruby on Rails:在安装gem时删除依赖项?

时间:2012-02-21 16:06:55

标签: ruby-on-rails ruby ruby-on-rails-3 rubygems twitter-bootstrap

我正在尝试在我的Windows机器上安装twitter-bootstrap-rails。这个宝石依赖于therubyracer,它与Windows不兼容。我发现了这个:

therubyracer gem on windows

这告诉我,我应该能够依靠JScript。虽然我不知道如何告诉gem安装忽略依赖。我试图强制安装:

    gem install -f twitter-bootstrap-rails --platform ruby 

无济于事。有没有人怎么说“gem install twitter-bootstrap-rails [但忽略对therubyracer的依赖]”?

2 个答案:

答案 0 :(得分:7)

如果你的目标是在Windows上使用rails twitter boostrap,那么有一个版本使用静态CSS,避免了对therubyracer的固定依赖。这将安装在Windows上。您将没有Less功能,但它在Windows中可以使用。在你的Gemfile中试试这个:

gem 'twitter-bootstrap-rails', :git => "git://github.com/seyhunak/twitter-bootstrap-rails.git", :branch => "static"

答案 1 :(得分:5)

根据this doc,有选项

-f, --[no-]force            Force gem to install, bypassing dependency checks

--ignore-dependencies        Do not install any required dependent gems