Bundler 安装失败,saltstack gem 状态
Bundler installation failing with saltstack gem state
我正在尝试安装捆绑器,但由于以下错误而失败。
ID: install_bundler
Function: gem.installed
Name: bundler
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1563, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/states/gem.py", line 81, in installed
gems = __salt__['gem.list'](name, ruby, gem_bin=gem_bin, runas=user)
File "/usr/lib/python2.7/dist-packages/salt/modules/gem.py", line 206, in list_
runas=runas)
File "/usr/lib/python2.7/dist-packages/salt/modules/gem.py", line 28, in _gem
return __salt__['rbenv.do_with_ruby'](ruby, cmdline, runas=runas)
File "/usr/lib/python2.7/dist-packages/salt/modules/rbenv.py", line 369, in do_with_ruby
return do(cmd, runas=runas)
File "/usr/lib/python2.7/dist-packages/salt/modules/rbenv.py", line 343, in do
env=environ
File "/usr/lib/python2.7/dist-packages/salt/modules/cmdmod.py", line 1014, in run_all
use_vt=use_vt)
File "/usr/lib/python2.7/dist-packages/salt/modules/cmdmod.py", line 391, in _run
.format(cmd, kwargs, exc)
CommandExecutionError: Unable to run command ['RBENV_VERSION=2.1.2', 'gem', 'list', 'bundler'] with the context {'with_communicate': True, 'shell': False, 'env': {'UPSTART_INSTANCE': '', 'UPSTART_JOB': 'salt-minion', 'LC_ALL': 'C', 'PATH': '/usr/local/rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin', 'PWD': '/', 'TERM': 'linux'}, 'stdout': -1, 'close_fds': True, 'stdin': None, 'stderr': -1, 'cwd': '/root'}, reason: [Errno 2] No such file or directory
Started: 10:19:55.195415
Duration: 91.662 ms
Changes:
这是我的 rbenv.ssl
文件
rbenv:
pkg.latest:
- refresh: True
rbenv-deps:
pkg.installed:
- names:
- bash
- git
- openssl
- libssl-dev
- make
- curl
- autoconf
- bison
- build-essential
- libssl-dev
- libyaml-dev
- libreadline6-dev
- zlib1g-dev
- libncurses5-dev
ruby-2.1.0:
rbenv.absent:
- require:
- pkg: rbenv-deps
ruby-2.1.2:
rbenv.installed:
- default: True
- require:
- pkg: rbenv-deps
app-deps:
pkg.installed:
- names:
- libxml2-dev # required by nokogiri
- libxslt1-dev # required by nokogiri
- g++ # required by eventmachine
- libmysqlclient-dev # required by mysql
- libexpat1-dev # required by xmlparser
install_bundler:
gem.installed:
- name: bundler
- ruby: 2.1.2
/etc/profile.d/rbenv.sh:
file:
- managed
- user: root
- group: root
- mode: 755
- source: salt://rbenv/files/profile/rbenv.sh
- require:
- pkg: rbenv
我不知道我做错了什么。我尝试通过 hack 安装它并且它有效。
'RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.2 rbenv exec gem install bundler':
cmd.run:
- unless: 'RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.2 rbenv exec gem list | grep bundler'
如果有人能比运行使用 saltstack 安装捆绑器的命令更清楚,那就太好了。
我不完全确定出了什么问题,但你的 install_bundler 状态肯定需要 ruby-2.1.2.
看起来状态 运行 所在的环境在其 CLASSPATH 中没有 gem
命令。
我是上述票证的作者(NW0428)。我也找不到比这更好的解决方案(效果很好):
bundler:
cmd.run:
- name: RBENV_VERSION=2.1.2 gem install bundler
- unless: RBENV_VERSION=2.1.2 gem list bundler -i
我只需要从 gem.install
中删除 ruby 版本,一切正常。
install_bundler:
gem.installed:
- name: bundler
当状态试图使用错误的 gem
命令时,我们收到此错误。安装了 system-level Ubuntu Ruby 包,它首先在 PATH
中找到 /usr/bin/gem
,因此 gem 安装是失败 You don't have write permissions for the /var/lib/gems/[...] directory.
卸载 Ubuntu Ruby 软件包为我们解决了这个问题;然后状态发现 user-level gem
命令应该有,并且 gem 安装到正确的地方。
我正在尝试安装捆绑器,但由于以下错误而失败。
ID: install_bundler
Function: gem.installed
Name: bundler
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1563, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/states/gem.py", line 81, in installed
gems = __salt__['gem.list'](name, ruby, gem_bin=gem_bin, runas=user)
File "/usr/lib/python2.7/dist-packages/salt/modules/gem.py", line 206, in list_
runas=runas)
File "/usr/lib/python2.7/dist-packages/salt/modules/gem.py", line 28, in _gem
return __salt__['rbenv.do_with_ruby'](ruby, cmdline, runas=runas)
File "/usr/lib/python2.7/dist-packages/salt/modules/rbenv.py", line 369, in do_with_ruby
return do(cmd, runas=runas)
File "/usr/lib/python2.7/dist-packages/salt/modules/rbenv.py", line 343, in do
env=environ
File "/usr/lib/python2.7/dist-packages/salt/modules/cmdmod.py", line 1014, in run_all
use_vt=use_vt)
File "/usr/lib/python2.7/dist-packages/salt/modules/cmdmod.py", line 391, in _run
.format(cmd, kwargs, exc)
CommandExecutionError: Unable to run command ['RBENV_VERSION=2.1.2', 'gem', 'list', 'bundler'] with the context {'with_communicate': True, 'shell': False, 'env': {'UPSTART_INSTANCE': '', 'UPSTART_JOB': 'salt-minion', 'LC_ALL': 'C', 'PATH': '/usr/local/rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin', 'PWD': '/', 'TERM': 'linux'}, 'stdout': -1, 'close_fds': True, 'stdin': None, 'stderr': -1, 'cwd': '/root'}, reason: [Errno 2] No such file or directory
Started: 10:19:55.195415
Duration: 91.662 ms
Changes:
这是我的 rbenv.ssl
文件
rbenv:
pkg.latest:
- refresh: True
rbenv-deps:
pkg.installed:
- names:
- bash
- git
- openssl
- libssl-dev
- make
- curl
- autoconf
- bison
- build-essential
- libssl-dev
- libyaml-dev
- libreadline6-dev
- zlib1g-dev
- libncurses5-dev
ruby-2.1.0:
rbenv.absent:
- require:
- pkg: rbenv-deps
ruby-2.1.2:
rbenv.installed:
- default: True
- require:
- pkg: rbenv-deps
app-deps:
pkg.installed:
- names:
- libxml2-dev # required by nokogiri
- libxslt1-dev # required by nokogiri
- g++ # required by eventmachine
- libmysqlclient-dev # required by mysql
- libexpat1-dev # required by xmlparser
install_bundler:
gem.installed:
- name: bundler
- ruby: 2.1.2
/etc/profile.d/rbenv.sh:
file:
- managed
- user: root
- group: root
- mode: 755
- source: salt://rbenv/files/profile/rbenv.sh
- require:
- pkg: rbenv
我不知道我做错了什么。我尝试通过 hack 安装它并且它有效。
'RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.2 rbenv exec gem install bundler':
cmd.run:
- unless: 'RBENV_ROOT=/usr/local/rbenv RBENV_VERSION=2.1.2 rbenv exec gem list | grep bundler'
如果有人能比运行使用 saltstack 安装捆绑器的命令更清楚,那就太好了。
我不完全确定出了什么问题,但你的 install_bundler 状态肯定需要 ruby-2.1.2.
看起来状态 运行 所在的环境在其 CLASSPATH 中没有 gem
命令。
我是上述票证的作者(NW0428)。我也找不到比这更好的解决方案(效果很好):
bundler:
cmd.run:
- name: RBENV_VERSION=2.1.2 gem install bundler
- unless: RBENV_VERSION=2.1.2 gem list bundler -i
我只需要从 gem.install
中删除 ruby 版本,一切正常。
install_bundler:
gem.installed:
- name: bundler
当状态试图使用错误的 gem
命令时,我们收到此错误。安装了 system-level Ubuntu Ruby 包,它首先在 PATH
中找到 /usr/bin/gem
,因此 gem 安装是失败 You don't have write permissions for the /var/lib/gems/[...] directory.
卸载 Ubuntu Ruby 软件包为我们解决了这个问题;然后状态发现 user-level gem
命令应该有,并且 gem 安装到正确的地方。