Try ERPNext Buy Support Partners Foundation

ERPNext bench command not found

Traceback (most recent call last):
2: from /usr/bin/bench:5:in <main>' 1: from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:inrequire’
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require’: cannot load such file – bundler (LoadError)

Please help me with this error.

what is the command you executed?

I used this documentation.

I properly executed these two lines
-git clone bench-repo
-pip install --user -e bench-repo
Then I tried to execute this line i got an error.
- bench init frappe-bench && cd frappe-bench

Command ‘bench’ not found, but can be installed with:

sudo apt install ruby-active-model-serializers

Use these below commands :
sudo useradd -m -s /bin/bash erpnextuser
sudo passwd erpnextuser
sudo usermod -aG sudo erpnextuser
sudo mkdir -p /opt/erpnext
sudo chown -R erpnextuser /opt/erpnext/
su - erpnextuser
cd /opt/erpnext
git clone bench-repo
sudo pip install -e bench-repo
i think this would be the solution…

1 Like

I found another solution which solved the problem which was adding one line in bashrc file.
Thanks for the help though.

Can you explain me what have done let me try too…

Just added this line in bashrc file
Then restarted shell using
exec bash


k thanks.

can you share the path where the bashrc file is located?

the bashrc is in your home subdir. In theory, this should allow you to edit it…

nano ~/.bashrc

1 Like

i tried this but still facing the same error.
could you please guide me where to add that line in .bashrc file

What you could try is start another terminal console session, that should reset the PATH environment variable.

This is the right solution

Could you explain this is non-developer terms? I didn’t get it. I am getting the same issue after following the steps from the Frappe Installation documentation from the official source.

nano ~/.bashrc
type this command editor will open.
Then add this line in the file.
Then restart shell using , exec bash.

This is only help i can do as i stopped working on erpNext. Last time i worked on erpNext was a year ago.

This particular problem originates from installing bench using pip without sudo it seems.


pip install -e ./bench


sudo pip install -e ./bench

1 Like