Ruby Bundler Issue: Can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)

TomVanBC

Registered
Aug 24, 2021
2
1
3
Vancouver, BC, Canada
cPanel Access Level
Website Owner
I have been asked by my Web Hosting company to post a thread here on this issue. They are unable to resolve the issue and I have been unable to find anything similar. I suspect this is simply a configuration issue but I'm running in a jailshell when I connect to my (shared) server. I can't tweak and debug the way I am used to.

My initial goal was to register my Rails 6 (ruby 2.7.4) application using the cpanel Phusion Passenger interface but when I tried to enable dependencies, the ruby gems failed and told me to run bundle manually. When I tried that, I received the error in question and the hosting provider is at a loss.

The provider has enabled Ruby, and set my default version to v2.7.4. When I log in, I am getting the following error when trying to run bundler (and hence I can't install Rails, which is my ultimate goal).

Code:
[[email protected] ~]$ bundle -v
Traceback (most recent call last):
        2: from /opt/cpanel/ea-ruby27/root/usr/bin/bundle:23:in `<main>'
        1: from /opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/rubygems.rb:296:in `activate_bin_path'
/opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/rubygems.rb:277:in `find_spec_for_exe': can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)
The strange part is, I can install gems successfully. For example, I tried this from a clean environment:

Code:
gem install rails <--this succeeds

rails new appname <-- this fails because it throws the above error

Here is some additional information about my environment:

Code:
[[email protected] ~]$ ruby -v
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]

[[email protected] ~]$ env
MANPATH=/opt/cpanel/ea-ruby27/root/usr/bin/../local/bin:/opt/cpanel/ea-ruby27/root/usr/share/man:
LD_LIBRARY_PATH=/opt/cpanel/ea-ruby27/root/usr/bin/../local/bin:/opt/cpanel/ea-ruby27/root/usr/lib64:/opt/cpanel/ea-openssl11/lib64
OPENSSL_NO_DEFAULT_ZLIB=1
PATH=/usr/local/cpanel/3rdparty/lib/path-bin:/opt/cpanel/ea-ruby27/root/usr/bin/../local/bin:/opt/cpanel/ea-ruby27/root/usr/bin:/opt/cpanel/ea-ruby27/root/usr/sbin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin:/opt/cpanel/composer/bin:/home2/thomjame/.local/bin:/home2/thomjame/bin
SHLVL=1
XDG_DATA_DIRS=/opt/cpanel/ea-ruby27/root/usr/share:/usr/local/share:/usr/share
PKG_CONFIG_PATH=/opt/cpanel/ea-ruby27/root/usr/bin/../local/bin:/opt/cpanel/ea-ruby27/root/usr/lib64/pkgconfig

[[email protected] ~]$ gem -v
3.1.6

[[email protected] ~]$ gem which bundler
/opt/cpanel/ea-ruby27/root/usr/share/ruby/ruby-2.7.4/bundler.rb
Any advice/help would be much appreciated. This should work, right? (Ruby is installed; Phusion Passenger is installed; all the ingredients are there...)
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,491
1,008
313
cPanel Access Level
Root Administrator
Hey there! I agree - with everything you've said there, it should just work. *Should* being the operative word........

I also don't have any history of that exact error on my end, so it's possible we're in uncharted territory.

The only thing that seems odd to me is your host's recommendation to post here. While we try and be quick and helpful, the forums aren't an official support channel, and as a provider with root access to the machine they would have the option to submit a ticket to us at any time so we can examine the machine. Since I'm not seeing anything quite like this on my end, having them create a ticket so we can do some more investigation might be the best way to get this resolved.
 
Thread starter Similar threads Forum Replies Date
R Account Administration 3