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


Aug 24, 2021
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).

[[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:

gem install rails <--this succeeds

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

Here is some additional information about my environment:

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

[[email protected] ~]$ env

[[email protected] ~]$ gem -v

[[email protected] ~]$ gem which bundler
Any advice/help would be much appreciated. This should work, right? (Ruby is installed; Phusion Passenger is installed; all the ingredients are there...)


Jurassic Moderator
Staff member
Oct 19, 2014
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