Bench installation fails - Ubuntu 18.04

I’m following the manual installation guide for putting ERPNext on my Ubuntu 18.04 server. This is a base install running nothing else
I have got to the point of bench init <benchname> and I get this:

~$ bench init frappe-bench

Command 'bench' not found, but can be installed with:

sudo apt install ruby-active-model-serializers

I get the same response with bench --version.

How can I debug this further? What is causing the bench install to fail, but appear like it’s OK to pip?

Here’s the previous terminal text from git clone onwards.

ubuntu@ip-xxx-xxx-xxx-xxx:~$ git clone
Cloning into 'bench'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 6037 (delta 7), reused 7 (delta 3), pack-reused 6018
Receiving objects: 100% (6037/6037), 29.66 MiB | 18.81 MiB/s, done.
Resolving deltas: 100% (3852/3852), done.
ubuntu@ip-xxx-xxx-xxx-xxx:~$ pip install -e ./bench
Obtaining file:///home/ubuntu/bench
Collecting Click (from bench==4.1.0)
  Downloading (81kB)
    100% |████████████████████████████████| 81kB 2.8MB/s 
Collecting GitPython==2.1.11 (from bench==4.1.0)
  Downloading (448kB)
    100% |████████████████████████████████| 450kB 2.6MB/s 
Collecting honcho (from bench==4.1.0)
Collecting jinja2 (from bench==4.1.0)
  Downloading (126kB)
    100% |████████████████████████████████| 133kB 8.5MB/s 
Collecting python-crontab (from bench==4.1.0)
  Downloading (44kB)
    100% |████████████████████████████████| 51kB 11.1MB/s 
Collecting requests (from bench==4.1.0)
  Downloading (57kB)
    100% |████████████████████████████████| 61kB 10.0MB/s 
Collecting semantic_version (from bench==4.1.0)
Collecting virtualenv (from bench==4.1.0)
  Downloading (1.9MB)
    100% |████████████████████████████████| 1.9MB 628kB/s 
Collecting gitdb2>=2.0.0 (from GitPython==2.1.11->bench==4.1.0)
  Downloading (62kB)
    100% |████████████████████████████████| 71kB 9.3MB/s 
Collecting MarkupSafe>=0.23 (from jinja2->bench==4.1.0)
Collecting python-dateutil (from python-crontab->bench==4.1.0)
  Downloading (225kB)
    100% |████████████████████████████████| 235kB 368kB/s 
Collecting idna<2.8,>=2.5 (from requests->bench==4.1.0)
  Downloading (58kB)
    100% |████████████████████████████████| 61kB 4.3MB/s 
Collecting urllib3<1.25,>=1.21.1 (from requests->bench==4.1.0)
  Downloading (118kB)
    100% |████████████████████████████████| 122kB 5.6MB/s 
Collecting certifi>=2017.4.17 (from requests->bench==4.1.0)
  Downloading (146kB)
    100% |████████████████████████████████| 153kB 7.6MB/s 
Collecting chardet<3.1.0,>=3.0.2 (from requests->bench==4.1.0)
  Downloading (133kB)
    100% |████████████████████████████████| 143kB 8.2MB/s 
Collecting smmap2>=2.0.0 (from gitdb2>=2.0.0->GitPython==2.1.11->bench==4.1.0)
Collecting six>=1.5 (from python-dateutil->python-crontab->bench==4.1.0)
Building wheels for collected packages: python-crontab, semantic-version
  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 python-crontab semantic-version
Installing collected packages: Click, smmap2, gitdb2, GitPython, honcho, MarkupSafe, jinja2, six, python-dateutil, python-crontab, idna, urllib3, certifi, chardet, requests, semantic-version, virtualenv, bench
  Running develop for bench
Successfully installed Click-7.0 GitPython-2.1.11 MarkupSafe-1.1.0 bench certifi-2018.10.15 chardet-3.0.4 gitdb2-2.0.5 honcho-1.0.1 idna-2.7 jinja2-2.10 python-crontab-2.3.5 python-dateutil-2.7.5 requests-2.20.1 semantic-version-2.6.0 six-1.11.0 smmap2-2.0.5 urllib3-1.24.1 virtualenv-16.1.0
ubuntu@ip-xxx-xxx-xxx-xxx:~$ bench --version

Command 'bench' not found, but can be installed with:

sudo apt install ruby-active-model-serializers

maybe you should use manual install from there it looks the same in general but have some differences

Try this :

[Guide: Manual Install ERPNext on Ubuntu 17.xx & 18.xx]
(Guide To Install ERPNext ON 18.04)

1 Like

Hi - the only difference I could see was the bench checkout folder name “bench-repo”. I’ll have another look this evening.

Thanks Mim, I’ll have a compare between this and the guide in the github documentation.

when you go through the guide and get error access denied for user root

check this link

(access denied)

Don’t know whati was doing wrong the first time.
I wiped my Ubuntu install and started again. Worked perfectly.

1 Like