Command 'bench' not found


I am doing manual installation in Ubuntu 18.10 and getting following error while running “bench” command.

Command 'bench' not found, but can be installed with: sudo apt install ruby-active-model-serializers

Same error also getting in Ubuntu 18.04.


I think you missed these first commands:

git clone bench-repo
pip install --user -e bench-repo

Not at all. If I run bench command after installing followings:

sudo apt install ruby-active-model-serializers

I am getting following error:

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:in `require'
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- bundler (LoadError)

bench is not a standard linux package. It can be installed via the commands I mentioned.

Find the complete installation steps here:

I did these installation many times for last couple of years, starting from Ubuntu 14.04. But, this error is something new to me.

at what step did you get this error

Got the same problem. followed hitchhikers guide.
All worked well with the addition of some extra sudo apt-get update commands when things did not install first time.
this is the last command…
ubuntu@ip-172-31-12-11:~$ sudo npm install -g yarn
/usr/bin/yarn → /usr/lib/node_modules/yarn/bin/yarn.js
/usr/bin/yarnpkg → /usr/lib/node_modules/yarn/bin/yarn.js

  • yarn@1.12.3
    added 1 package in 0.457s

last bit of yarn install above as per instructions

ubuntu@ip-172-31-12-11:~$ git clone GitHub - frappe/bench: CLI to manage Multi-tenant deployments for Frappe apps
Cloning into ‘bench’…
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 6057 (delta 1), reused 2 (delta 0), pack-reused 6049
Receiving objects: 100% (6057/6057), 29.67 MiB | 16.61 MiB/s, done.
Resolving deltas: 100% (3867/3867), done.
warning: unable to access ‘/home/ubuntu/.config/git/attributes’: Permission denied

So tried pip install frappe-bench instead
ubuntu@ip-172-31-12-11:~$ pip install frappe-bench
Collecting frappe-bench
Downloading (44kB)
100% |████████████████████████████████| 51kB 8.1MB/s
Collecting GitPython (from frappe-bench)
Downloading (448kB)
100% |████████████████████████████████| 450kB 2.5MB/s
Collecting click (from frappe-bench)
Downloading (81kB)
100% |████████████████████████████████| 81kB 8.7MB/s
Collecting honcho (from frappe-bench)
Collecting jinja2 (from frappe-bench)
Downloading (126kB)
100% |████████████████████████████████| 133kB 7.5MB/s
Collecting psutil (from frappe-bench)
Downloading (422kB)
100% |████████████████████████████████| 430kB 2.8MB/s
Collecting python-crontab (from frappe-bench)
Downloading (44kB)
100% |████████████████████████████████| 51kB 10.7MB/s
Collecting requests (from frappe-bench)
Downloading (57kB)
100% |████████████████████████████████| 61kB 9.7MB/s
Collecting semantic_version (from frappe-bench)
Collecting six (from frappe-bench)
Collecting virtualenv (from frappe-bench)
Downloading (1.9MB)
100% |████████████████████████████████| 1.9MB 607kB/s
Collecting gitdb2>=2.0.0 (from GitPython->frappe-bench)
Downloading (62kB)
100% |████████████████████████████████| 71kB 11.4MB/s
Collecting MarkupSafe>=0.23 (from jinja2->frappe-bench)
Collecting python-dateutil (from python-crontab->frappe-bench)
Downloading (225kB)
100% |████████████████████████████████| 235kB 5.2MB/s
Collecting urllib3<1.25,>=1.21.1 (from requests->frappe-bench)
Downloading (118kB)
100% |████████████████████████████████| 122kB 9.1MB/s
Collecting certifi>=2017.4.17 (from requests->frappe-bench)
Downloading (154kB)
100% |████████████████████████████████| 163kB 7.2MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests->frappe-bench)
Downloading (133kB)
100% |████████████████████████████████| 143kB 8.1MB/s
Collecting idna<2.9,>=2.5 (from requests->frappe-bench)
Downloading (58kB)
100% |████████████████████████████████| 61kB 10.1MB/s
Collecting setuptools>=18.0.0 (from virtualenv->frappe-bench)
Downloading (573kB)
100% |████████████████████████████████| 573kB 2.1MB/s
Collecting smmap2>=2.0.0 (from gitdb2>=2.0.0->GitPython->frappe-bench)
Building wheels for collected packages: frappe-bench, psutil, python-crontab, semantic-version
Running bdist_wheel for frappe-bench … done
Stored in directory: /home/ubuntu/.cache/pip/wheels/ac/ca/ed/4c7bd1c58c330950013183511f53b70a1c0f0813a3311904bb
Running bdist_wheel for psutil … done
Stored in directory: /home/ubuntu/.cache/pip/wheels/d2/71/40/9c6993129f8cda369d0f21c46a13a6adab7fb1664fe6512551
Running bdist_wheel for python-crontab … done
Stored in directory: /home/ubuntu/.cache/pip/wheels/fb/92/07/ee1918fa370be1c495aba19d219ad4e1c218846ecceb2622af
Running bdist_wheel for semantic-version … done
Stored in directory: /home/ubuntu/.cache/pip/wheels/60/bb/50/215d669d31f992767f5dd8d3c974e79261707ee7f898f0dc10
Successfully built frappe-bench psutil python-crontab semantic-version
Installing collected packages: smmap2, gitdb2, GitPython, click, honcho, MarkupSafe, jinja2, psutil, six, python-dateutil, python-crontab, urllib3, certifi, chardet, idna, requests, semantic-version, setuptools, virtualenv, frappe-bench
Successfully installed GitPython-2.1.11 MarkupSafe-1.1.0 certifi-2018.11.29 chardet-3.0.4 click-7.0 frappe-bench-4.1.2 gitdb2-2.0.5 honcho-1.0.1 idna-2.8 jinja2-2.10 psutil-5.4.8 python-crontab-2.3.5 python-dateutil-2.7.5 requests-2.21.0 semantic-version-2.6.0 setuptools-40.6.3 six-1.12.0 smmap2-2.0.5 urllib3-1.24.1 virtualenv-16.2.0

looked ok but then tested it by

ubuntu@ip-172-31-12-11:/$ bench --version
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:in require’
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require’: cannot load such file – bundler (LoadError)

No good

Where to next?
ps. I notice with this install the bench directory is inside ubuntu where as before I thought it was in the home directory alongside ubuntu.

fresh install on aws - ubuntu18.4 ssh using putty.

Are you executing bench while inside the frappe-bench folder?


to create frappe-bench folder we need to run bench init frappe bench which we cannot execute because of bench command not found error.

have you got the solution ?

@arokia, I din’t find exact solution of the issue. However, it has been fixed after re-installation of frappe.


The problem is you have create a user for the bench you missed though it creates bench command not found.
I too got this issue but i got the solution by following 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/
then follow bench repo command.

1 Like

Whatever you do, don’t install that package, it’s screwing more things up…

Yes perhaps post # 3 is ambiguous?

Nonetheless it gives the error result as proof why not to install ruby-active-model-serializers

Here’s a similar case Manual bench install error - what's this no Ruby required? - #8 by clarkej

kindly follow the steps given by me its a solution.

GOD BLESS YOU! it worked perfectly.

1 Like

@MisterD thank you✌️

export PATH=$PATH:~/.local/bin

worked for me


This helped.

Restarting the system worked for me.

1 Like