2

So this is a bit weird. Gem works fine. When I go to gem install bundler, the system outputs the following:

  Successfully installed bundler-1.16.2
  1 gem installed

When I check to see what gems are installed with gem list the bundler shows up:

  *** LOCAL GEMS ***

  bigdecimal (1.2.0)
  bundler (1.16.2)
  io-console (0.4.2)
  json (1.7.7)
  psych (2.0.0)
  rdoc (4.0.0)

and yet when I go to run bundle install, I get the following:

  bash: bundle: command not found

I have tried restarting the system, I have used yum erase gem and then reinstalled it, and I have tried gem install bundler again when it didn't work and I am still getting the same error. I am on CentOS 7.5

Thanks in advance for the help.

thePinochleKid
  • 120
  • 1
  • 6

1 Answers1

1

I'm a bit behind on CentOS 7.4 but that shouldn't matter here.

$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

Here I'm installing bundler:

$ sudo gem install bundler
Fetching: bundler-1.16.2.gem (100%)
Successfully installed bundler-1.16.2
Parsing documentation for bundler-1.16.2
Installing ri documentation for bundler-1.16.2
1 gem installed

And it's located here:

$ type -f bundler
bundler is /usr/local/bin/bundler

$ sudo bundler -v
Bundler version 1.16.2

And here's my $PATH:

$ sudo echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/java/latest/bin:/root/bin

However when I try the bundle command it fails for me in sudo as well:

$ sudo bundle -v
sudo: bundle: command not found

$ sudo type -f bundle
sudo: type: command not found

If I do this after logging directly into root it works though:

$ type -f bundle
bundle is hashed (/usr/local/bin/bundle)

If we do the full path it works as expected:

$ sudo /usr/local/bin/bundle -v
Bundler version 1.16.2

This would indicate that it's a $PATH issue when you're running the commands as different users.

slm
  • 363,520
  • 117
  • 767
  • 871