Telling Bundler to Exclude Certain Gems from a Particular Gem's Installation

Telling Bundler to exclude certain gems from a particular gem's installation

There is no option for this in Bundler.

So you're left with these options:

  • Don't use twitter-bootstrap-rails. You can just copy the compiled css and js files into the proper directories under vendor/assets. You'll lose the ability to change less variables. Or you can use the compass_twitter_bootstrap gem, which uses sass instead of less.

  • Get the maintainer of the less gem to use execjs instead of commonjs and therubyracer. It would probably mean significant refactoring for the maintainer(s) if at all possible.

  • Use the :platform option in your Gemfile, to only install on OSX or Linux. Then require the parts you can use by hand, without loading less. This probably won't work.

How to tell bundler to ignore gems that don't exist?

This is expected behaviour. From the docs:

While the --without option will skip installing the gems in the specified groups, it will still download those gems and use them to resolve the dependencies of every gem in your Gemfile(5).

Whilst an up to date Gemfile.lock might suggest that the dependencies don’t need to be resolved again, it looks like all gems are downloaded even in this case.

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

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

Why Bundle Install is installing gems in vendor/bundle?

  1. Use bundle env to view paths and bundle configuration

  2. After this set bundle path to ~/.rvm/gems/ruby-2.0.0-p247 like this:

    bundle install --path ~/.rvm/gems/ruby-2.0.0-p247

    which is global and also you can use your own custom path.

  3. Post this bundle install will never need path again and will always install all of your gems in that directory(~/.rvm/gems/ruby-2.0.0-p247 in my case) for that app not in app_folder/vendor/bundle



Related Topics



Leave a reply



Submit