【发布时间】:2014-06-26 14:50:05
【问题描述】:
我的系统上安装了 SASS gem (v3.3.8),但我有一个需要 v3.2.19 的项目。我还有一种情况,即存在 v3.2.19 的系统存在冲突(如果安装了任何旧版本的 gem,Codekit 将不会编译 SASS)。
我使用 Bundler 在我的项目本地文件夹中安装了所需 gem 的副本:
my_project/src/vendor/bundle/ruby/...
如何强制我的项目将本地文件夹中的 ruby gem 用于我的 grunt 任务,而不是全局安装在我的系统上的那些?
# A sample Gemfile
source "https://rubygems.org"
gem 'autoprefixer-rails', ">=1.2.0.20140609"
gem 'breakpoint', ">=2.0.7"
gem 'compass', ">=0.12.6"
gem 'sass', ">=3.2.19"
gem 'singularitygs', ">=1.1.2"
【问题讨论】:
-
在项目目录(
Gemfile所在的位置)中运行bundle install以安装 gem 并使用bundle exec ...启动可执行文件,例如bundle exec compass compile -
我已经跑过
bundle install --path vendor/bundle。我正在尝试使用:path =>指向这些文件而不是系统文件,但是无论我在vendor/bundle文件夹中的哪个位置查看,我都会收到一条错误消息:Could not find gem 'compass (>= 0.12.6) ruby' in source at vendor/bundle/ruby/2.0.0/cache. Source does not contain any versions of 'compass (>= 0.12.6) ruby'。 philsinatra.net/_ex/ss.png
标签: ruby gem rubygems bundle bundler