本文介绍了告诉Bundler从特定宝石的安装中排除某些宝石的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在gemfile中,有什么方法可以告诉Bundler:

Within a gemfile, is there any way to tell Bundler something like:

gem 'twitter-bootstrap-rails', :exclude therubyracer

我需要安装twitter-bootstrap-rails,但它会自动拉 therubyracer ,因此捆绑安装失败,并且引导程序未包含在项目中,因为这是Windows计算机。我安装了execjs无济于事。

I need to install twitter-bootstrap-rails but it automatically pulls therubyracer in, so bundle install fails and bootstrap isn't included in the project since this is a Windows machine. I installed execjs to no avail.

我试图列出生产中的 therubyracer 捆绑安装-无生产,也无济于事。

I tried to list therubyracer under production, and bundle install --without production, also to no avail.

也是这个问题,但是没有一个建议可以改变我得到的错误。

"therubyracer gem on windows" is also this problem, but none of the suggestions there change the error I'm getting.

我的旧线程是 。

推荐答案

Bundler中没有此选项。

There is no option for this in Bundler.

因此,您剩下这些选项:

So you're left with these options:


  • 不要使用 twitter-bootstrap-rails 。您只需将已编译的css和js文件复制到 vendor / assets 下的适当目录中即可。您将无法更改较少的变量。或者,您可以使用 compass_twitter_bootstrap gem,它使用sass而不是更少的内容。

  • 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.

获取以下内容的维护者 less 宝石可使用 execjs 代替 commonjs therubyracer

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.

使用:platform

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.

这篇关于告诉Bundler从特定宝石的安装中排除某些宝石的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 17:50