简体   繁体   中英

Ruby on Rails: Removing a dependency while installing a gem?

I'm attempting to gem install twitter-bootstrap-rails on my windows machine. This gem has a dependency on therubyracer, which is not yet compatible with Windows. I found this:

therubyracer gem on windows

Which tells me I should just be able to lean on JScript. Though I don't know how to tell the gem install to ignore dependencies. I've tried to force install with:

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

To no avail. Does anyone how I can say something like "gem install twitter-bootstrap-rails [but ignore that dependency on therubyracer]"?

If your goal is to get the rails twitter boostrap working on Windows, there is a version of this that uses static CSS, avoiding the fixed dependency on therubyracer. This will install on Windows. You won't have the Less functionality, but it does work in Windows. Try this in your Gemfile:

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

According to this doc , there's the options

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

and

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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