Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run script provided by installed gem #213

Closed
pfaffle opened this issue May 24, 2018 · 3 comments
Closed

Unable to run script provided by installed gem #213

pfaffle opened this issue May 24, 2018 · 3 comments

Comments

@pfaffle
Copy link

pfaffle commented May 24, 2018

I have automation which runs in a Jenkins pipeline which uses the Ruby Docker container as the execution environment. Just last night, a job started failing because it was unable to find a script that is provided by a gem that I install as part of the job.

It seems the scripts are landing in /usr/local/bundle/bin, but that directory is not on my path.

I'm using the ruby:2.4 image. Below is some output from me reproducing the error on my local workstation and poking around at the environment and filesystem in the container:

docker run -it ruby:2.4 /bin/bash

root@9822526cb6fb:/#
root@9822526cb6fb:/# gem install tw-vsphere --source [my_local_repo]
Fetching: builder-3.2.3.gem (100%)
Successfully installed builder-3.2.3
Fetching: mini_portile2-2.3.0.gem (100%)
Successfully installed mini_portile2-2.3.0
Fetching: nokogiri-1.8.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed nokogiri-1.8.2
Fetching: trollop-2.1.2.gem (100%)
Successfully installed trollop-2.1.2
Fetching: rbvmomi-1.12.0.gem (100%)
Successfully installed rbvmomi-1.12.0
Fetching: tw-vsphere-0.1.7.gem (100%)
Successfully installed tw-vsphere-0.1.7
6 gems installed
root@9822526cb6fb:/# reap_expired_vms
bash: reap_expired_vms: command not found
root@9822526cb6fb:/# echo $PATH
/usr/local/bundle/gems/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@9822526cb6fb:/# env
RUBYGEMS_VERSION=2.7.7
BUNDLER_VERSION=1.16.2
HOSTNAME=9822526cb6fb
RUBY_VERSION=2.4.4
GEM_HOME=/usr/local/bundle
PWD=/
HOME=/root
BUNDLE_PATH=/usr/local/bundle
BUNDLE_APP_CONFIG=/usr/local/bundle
TERM=xterm
BUNDLE_SILENCE_ROOT_WARNING=1
RUBY_MAJOR=2.4
BUNDLE_BIN=/usr/local/bundle/bin
SHLVL=1
RUBY_DOWNLOAD_SHA256=1d0034071d675193ca769f64c91827e5f54cb3a7962316a41d5217c7bc6949f0
PATH=/usr/local/bundle/gems/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
root@9822526cb6fb:/# ls /usr/local/bundle/gems/bin
ls: cannot access '/usr/local/bundle/gems/bin': No such file or directory
root@9822526cb6fb:/# ls /usr/local/bundle/gems/
builder-3.2.3  mini_portile2-2.3.0  nokogiri-1.8.2  rbvmomi-1.12.0  trollop-2.1.2  tw-vsphere-0.1.7
root@9822526cb6fb:/# ls /usr/local/bundle/bin
nokogiri  rbvmomish  reap_expired_vms  reap_vms_owned_by
root@9822526cb6fb:/#
@tianon
Copy link
Member

tianon commented May 24, 2018

Duplicate of #211 and #212, fixed by #209.

@tianon tianon closed this as completed May 24, 2018
@pfaffle
Copy link
Author

pfaffle commented May 24, 2018

Sorry for the duplicate report. I just pulled the latest build down from Docker Hub though and it still has the issue. Do I just need to wait for a new build?

@tianon
Copy link
Member

tianon commented May 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants