Command 'bench' not found

Hi,

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.

3 Likes

I think you missed these first commands:

git clone https://github.com/frappe/bench 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 https://files.pythonhosted.org/packages/4f/e4/b4b81dfc4dc7c38222e7e814f4680cf1c2fd95dad48a8b63716ba4aa869f/frappe-bench-4.1.2.tar.gz (44kB)
100% |████████████████████████████████| 51kB 8.1MB/s
Collecting GitPython (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/fe/e5/fafe827507644c32d6dc553a1c435cdf882e0c28918a5bab29f7fbebfb70/GitPython-2.1.11-py2.py3-none-any.whl (448kB)
100% |████████████████████████████████| 450kB 2.5MB/s
Collecting click (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
100% |████████████████████████████████| 81kB 8.7MB/s
Collecting honcho (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/12/c2/95faf9e062e37f50fb685972692395bef019a554c08447282a81e35bf031/honcho-1.0.1-py2.py3-none-any.whl
Collecting jinja2 (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl (126kB)
100% |████████████████████████████████| 133kB 7.5MB/s
Collecting psutil (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/e3/58/0eae6e4466e5abf779d7e2b71fac7fba5f59e00ea36ddb3ed690419ccb0f/psutil-5.4.8.tar.gz (422kB)
100% |████████████████████████████████| 430kB 2.8MB/s
Collecting python-crontab (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/66/88/4f443440230dd28158bac16dcccd8c9834cee55845bf83e85550d2e389ac/python-crontab-2.3.5.tar.gz (44kB)
100% |████████████████████████████████| 51kB 10.7MB/s
Collecting requests (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl (57kB)
100% |████████████████████████████████| 61kB 9.7MB/s
Collecting semantic_version (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/72/83/f76958017f3094b072d8e3a72d25c3ed65f754cc607fdb6a7b33d84ab1d5/semantic_version-2.6.0.tar.gz
Collecting six (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting virtualenv (from frappe-bench)
Downloading https://files.pythonhosted.org/packages/6a/d1/e0d142ce7b8a5c76adbfad01d853bca84c7c0240e35577498e20bc2ade7d/virtualenv-16.2.0-py2.py3-none-any.whl (1.9MB)
100% |████████████████████████████████| 1.9MB 607kB/s
Collecting gitdb2>=2.0.0 (from GitPython->frappe-bench)
Downloading https://files.pythonhosted.org/packages/da/30/a407568aa8d8f25db817cf50121a958722f3fc5f87e3a6fba1f40c0633e3/gitdb2-2.0.5-py2.py3-none-any.whl (62kB)
100% |████████████████████████████████| 71kB 11.4MB/s
Collecting MarkupSafe>=0.23 (from jinja2->frappe-bench)
Downloading https://files.pythonhosted.org/packages/bc/3a/6bfd7b4b202fa33bdda8e4e3d3acc719f381fd730f9a0e7c5f34e845bd4d/MarkupSafe-1.1.0-cp27-cp27mu-manylinux1_x86_64.whl
Collecting python-dateutil (from python-crontab->frappe-bench)
Downloading https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl (225kB)
100% |████████████████████████████████| 235kB 5.2MB/s
Collecting urllib3<1.25,>=1.21.1 (from requests->frappe-bench)
Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB)
100% |████████████████████████████████| 122kB 9.1MB/s
Collecting certifi>=2017.4.17 (from requests->frappe-bench)
Downloading https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl (154kB)
100% |████████████████████████████████| 163kB 7.2MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests->frappe-bench)
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 8.1MB/s
Collecting idna<2.9,>=2.5 (from requests->frappe-bench)
Downloading https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 10.1MB/s
Collecting setuptools>=18.0.0 (from virtualenv->frappe-bench)
Downloading https://files.pythonhosted.org/packages/37/06/754589caf971b0d2d48f151c2586f62902d93dc908e2fd9b9b9f6aa3c9dd/setuptools-40.6.3-py2.py3-none-any.whl (573kB)
100% |████████████████████████████████| 573kB 2.1MB/s
Collecting smmap2>=2.0.0 (from gitdb2>=2.0.0->GitPython->frappe-bench)
Downloading https://files.pythonhosted.org/packages/55/d2/866d45e3a121ee15a1dc013824d58072fd5c7799c9c34d01378eb262ca8f/smmap2-2.0.5-py2.py3-none-any.whl
Building wheels for collected packages: frappe-bench, psutil, python-crontab, semantic-version
Running setup.py bdist_wheel for frappe-bench … done
Stored in directory: /home/ubuntu/.cache/pip/wheels/ac/ca/ed/4c7bd1c58c330950013183511f53b70a1c0f0813a3311904bb
Running setup.py bdist_wheel for psutil … done
Stored in directory: /home/ubuntu/.cache/pip/wheels/d2/71/40/9c6993129f8cda369d0f21c46a13a6adab7fb1664fe6512551
Running setup.py bdist_wheel for python-crontab … done
Stored in directory: /home/ubuntu/.cache/pip/wheels/fb/92/07/ee1918fa370be1c495aba19d219ad4e1c218846ecceb2622af
Running setup.py 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?

2 Likes

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.

BR/Mijan

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

4 Likes

This helped.

Restarting the system worked for me.

1 Like