Ansible:gem 列表中缺少罗盘核心
Ansible : compass-core missing in gem list
我遇到了 grunt 构建的问题,所以我检查了指南针的版本 (compass -v
),结果出现了同样的消息:
stderr: /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find compass-core (~> 1.0.2) amongst [compass-1.0.3, sass-3.4.18] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:777:in `block in activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `each'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:750:in `activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:1232:in `gem'
from /usr/local/bin/compass:22:in `<main>'
我已经为我的服务器提供了 ansible,并且我已经检查过 sass :
Sass 3.4.18 (Selective Steve)
有人知道如何调试吗?
编辑
事实上,我使用的是旧方法来安装 sass 和指南针。
卸载并重播ansible任务后,我看到只有root安装了gem。
$ gem list
*** LOCAL GEMS ***
$ sudo gem list
*** LOCAL GEMS ***
chunky_png (1.3.4)
compass (1.0.3)
compass-core (1.0.3)
compass-import-once (1.0.5)
ffi (1.9.10)
multi_json (1.11.2)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
sass (3.4.18)
所以我的问题变了:How to install gem for a specific user or for all the user with ansible ?
这是我的 ansible 脚本:
- name: Install ruby gems as Grunt dependencies
gem: name="{{ item }}" state=present include_dependencies=yes user_install=yes
with_items:
- sass
- compass
include_depencies 和 user_install 是可选标志
要为特定用户安装 gem,您需要在用户上下文中 运行 它,例如
- name: Install ruby gems as Grunt dependencies
gem: name="{{ item }}" state=present include_dependencies=yes user_install=yes
with_items:
- sass
- compass
become: yes
become_user: someuser
要全局安装它,请将 user_install
设置为假值:
- name: Install ruby gems as Grunt dependencies
gem: name="{{ item }}" state=present include_dependencies=yes user_install=no
with_items:
- sass
- compass
become: yes
become_user: root
我遇到了 grunt 构建的问题,所以我检查了指南针的版本 (compass -v
),结果出现了同样的消息:
stderr: /usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find compass-core (~> 1.0.2) amongst [compass-1.0.3, sass-3.4.18] (Gem::LoadError)
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:777:in `block in activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `each'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:766:in `activate_dependencies'
from /usr/lib/ruby/1.9.1/rubygems/specification.rb:750:in `activate'
from /usr/lib/ruby/1.9.1/rubygems.rb:1232:in `gem'
from /usr/local/bin/compass:22:in `<main>'
我已经为我的服务器提供了 ansible,并且我已经检查过 sass :
Sass 3.4.18 (Selective Steve)
有人知道如何调试吗?
编辑
事实上,我使用的是旧方法来安装 sass 和指南针。 卸载并重播ansible任务后,我看到只有root安装了gem。
$ gem list
*** LOCAL GEMS ***
$ sudo gem list
*** LOCAL GEMS ***
chunky_png (1.3.4)
compass (1.0.3)
compass-core (1.0.3)
compass-import-once (1.0.5)
ffi (1.9.10)
multi_json (1.11.2)
rb-fsevent (0.9.5)
rb-inotify (0.9.5)
sass (3.4.18)
所以我的问题变了:How to install gem for a specific user or for all the user with ansible ?
这是我的 ansible 脚本:
- name: Install ruby gems as Grunt dependencies
gem: name="{{ item }}" state=present include_dependencies=yes user_install=yes
with_items:
- sass
- compass
include_depencies 和 user_install 是可选标志
要为特定用户安装 gem,您需要在用户上下文中 运行 它,例如
- name: Install ruby gems as Grunt dependencies
gem: name="{{ item }}" state=present include_dependencies=yes user_install=yes
with_items:
- sass
- compass
become: yes
become_user: someuser
要全局安装它,请将 user_install
设置为假值:
- name: Install ruby gems as Grunt dependencies
gem: name="{{ item }}" state=present include_dependencies=yes user_install=no
with_items:
- sass
- compass
become: yes
become_user: root