Created
July 6, 2015 11:01
-
-
Save AmitChotaliya/8d983f598dac27c98e5d to your computer and use it in GitHub Desktop.
salt stack gem install bundler not working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am trying to install bundler but It is failing due to the following error. | |
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: | |
Here's my rbenv.ssl file | |
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 | |
I don't know what I am doing wrong. I tried installing it by a hack and it works. | |
'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' | |
It would be great if anyone has any way clearer than running a command to install bundler using saltstack. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment