Try ERPNext Buy Support Partners Foundation

ERPNext with Ubuntu 18.04.3 Server

Hello, i try to install ERPNext on Ubuntu 18.04.3 LTS.

No i get this error:

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)
undine@ubu:~$ 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)

How can i solved the problem?

jannis

I will try this:

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 https://github.com/frappe/bench
sudo pip install -e bench-repo

Now i get this error:

sudo pip install -e bench-repo
The directory '/home/erpnextuser/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/erpnextuser/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
bench-repo should either be a path to a local project or a VCS url beginning with svn+, git+, hg+, or bzr+

Solution, reboot the system, than:

bench --version
4.1.0

With such posts please include the command prompt as that helps with context for eg

frappe@ubuntu:~/frappe-bench$ which bench
/usr/local/bin/bench
frappe@ubuntu:~/frappe-bench$ bench version
erpnext 11.1.41
frappe 11.1.37

This is the command prompt part:

frappe@ubuntu:~/frappe-bench$

Also too you seem to have installed some ruby - ERPNext does not require that!

i have edit my post, did you mean so?

Why did you mean, i have installed ruby?

In only use this manual:

The Hitchhiker’s Guide to Installing Frappe on Linux
saiindhu edited this page on 27 Sep 2019 · 8 revisions

Your post # 1 suggests you installed ruby… a forum search on say ‘rubygems’ will explain why that can be a misstep.

Thanks

Did we have a script "easy-install for Ubuntu 18.04.3 Server, Debian 10 or CentOS 8?

“Works on Ubuntu 16.04+, CentOS 7+, Debian 8+”

That said for sure YMMV so check the forum for help details say for eg Error on ERPNext - Ubuntu 18.04 LTS Installation

The easy installation script does not seem to end without errors on the latest versions of Ubuntu, sadly. :frowning:

Hello, should with manual work without problems?
Last Updated: October 22, 2019:

It looks easier for me and it is a newer tutorial.

Problem speedysense 01:

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/
sudo tar -xf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz -C /opt`

Change to:

wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz

Check:

wkhtmltopdf -V
wkhtmltopdf 0.12.4 (with patched qt)

save jannis

Now: Step 9 Install and Create Virtual Environment

Step 12 Get ERPNext Apps

Problem speedysense 02:

    bench get-app --branch master erpnext https://github.com/frappe/erpnext.git
INFO:bench.app:getting app erpnext
INFO:bench.utils:git clone https://github.com/frappe/erpnext.git --branch master --depth 1 --origin upstream
fatal: destination path 'erpnext' already exists and is not an empty directory.
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/home/jannis/erpnext/bench-repo/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jannis/erpnext/bench-repo/bench/commands/make.py", line 42, in get_app
    get_app(git_url, branch=branch, skip_assets=skip_assets)
  File "/home/jannis/erpnext/bench-repo/bench/app.py", line 125, in get_app
    cwd=os.path.join(bench_path, 'apps'))
  File "/home/jannis/erpnext/bench-repo/bench/utils.py", line 173, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: git clone https://github.com/frappe/erpnext.git --branch master --depth 1 --origin upstream

How can i solved this problem?

jannis

I think that you should use version-12 as branch in place of master

bench init --frappe-branch version-12 --frappe-path https://github.com/frappe/frappe.git frappe-bench

https://pastebin.com/7bi9dy8Q

Try starting over and use the steps detailed here:

Both the manual and easy install methods were broken and this is at least one well tested way to get a server running.

As always… Your mileage may vary… :sunglasses:

BKM

Hello bkm, at which step should start again with my installation?

Is " Step 9 Install and Create Virtual Environment" ok?

No, I would re-install the VPS operating system and begin again from a clean server. I would not use the instructions at SpeedySense because they were written at a time when the install process was more stable.

Since the publishing of those instructions much has changed. So I recommend getting your OS clean and fresh, then use the instructions in my link to do the install from scratch.

The only thing I would add would be to do the

apt-get update
apt-get upgrade

Do those 2 commands from the root directory before you create the new user in my instructions. The instructions I linked to have been successfully run as late as this morning, so you have a very good chance of finding success today.

NOTE Even in the instructions that I linked, you will encounter errors but they are explained in the post and you have additional instructions for getting past the errors to a successful server.

BKM

New fresh Ubuntu 18.04.3 LTS install.

Tutorial bkm, link therefore.
httxx://discuss.erpnext.com/t/error-on-erpnext-ubuntu-18-04-lts-installation/54961/31

def_user@ubu:~$ wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
--2020-01-10 16:20:42--  https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.12.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.12.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14831 (14K) [text/plain]
Saving to: ‘install.py.2’

install.py.2              100%[==================================>]  14,48K  --.-KB/s    in 0,03s   

2020-01-10 16:20:42 (447 KB/s) - ‘install.py.2’ saved [14831/14831]

def_user@ubu:~$ sudo -H python3 install.py –production –user [def_user]
usage: install.py [-h] [--develop | --production] [--site SITE]
                  [--without-site] [--verbose] [--user USER]
                  [--bench-branch BENCH_BRANCH] [--repo-url REPO_URL]
                  [--frappe-repo-url FRAPPE_REPO_URL]
                  [--frappe-branch FRAPPE_BRANCH]
                  [--erpnext-repo-url ERPNEXT_REPO_URL]
                  [--erpnext-branch ERPNEXT_BRANCH] [--without-erpnext]
                  [--version VERSION] [--overwrite]
                  [--mysql-root-password MYSQL_ROOT_PASSWORD]
                  [--mariadb-version MARIADB_VERSION]
                  [--admin-password ADMIN_PASSWORD] [--bench-name BENCH_NAME]
                  [--container]
install.py: error: unrecognized arguments: –production –user [def_user]
def_user@ubu:~$

Where is my mistake?

The mistake was in the arguments for the install.py command. When I typed them into the forum it combined the double dashes into a single long dash

The command should look like this

sudo -H python3 install.py --production --user [def_user]

And then you must change [def_user] to whatever username you created with the “adduser” command. So for example, if you did this:

adduser jannnis

then your command would look like this:

sudo -H python3 install.py --production --user jannis

The instructions state to create the new user and give it sudo access. That would look like this:

adduser jannis
usermod -aG sudo jannis

Then to logout out of the server and log back in as the new user, in this case jannis.

Then start using all of the commands.

Anytime you see in my example commands something in brackets [like_this] it meas that you substitute your information there. Just like in the [def_user] gets replaces with jannis.

Hope this helps.

BKM

Hello bkm, your turorial have little mistake:
Wrong:
sudo -H python3 install.py –production –user [def_user]

Right:
sudo -H python3 install.py --production --user [def_user]

In my jannis case:
sudo -H python3 install.py --production --user def_user

My defaultuser is now “def_user”

def_user for defaultuser with sudo right.

Can i use a ssh connection to install ERPNext without problems?

Thank you

Yes. Connect as the def_user.

BKM

NOTE - I will try to edit the original instructions again. My browser and the forum evidently do not agree with each other on how dashes are supposed to be included. I will use a different browser to try to do the edits.

def_user@ubu:~$ sudo -H python3 install.py --production --user def_user
[sudo] password for def_user: 
Logs are saved under /tmp/logs/easy-install__2020-01-10__17-12.log
Checking System Compatibility...
ubuntu 18 is compatible!
Bench's CLI needs these to be defined!
Run the following commands in shell: 
export LC_ALL=C.UTF-8
def_user@ubu:~$ export LC_ALL=C.UTF-8
def_user@ubu:~$

Next Step:

def_user@ubu:~$ cd /tmp/.bench/playbooks/roles/nodejs/tasks
-bash: cd: /tmp/.bench/playbooks/roles/nodejs/tasks: No such file or directory
def_user@ubu:~$

How get i “bench” and “nodesjs” with your tutorial?
httxx://discuss.erpnext.com/t/error-on-erpnext-ubuntu-18-04-lts-installation/54961/31

The problem was that your edition of Ubuntu needed the UTF-8 adjustment. So after you ran:

def_user@ubu:~$ export LC_ALL=C.UTF-8

Your actual next step would be to restart the install command. The error was warning you that the install could not continue unless the UTF-8 adjustment was made. So after performing the suggested command you need to re-reun the install command:

sudo -H python3 install.py --production --user def_user

Then you will be caught up again.

BKM

Very important! ```
export LC_ALL=C.UTF-8

**

> The problem was that your edition of Ubuntu needed the UTF-8 adjustment. 

**

    def_user@ubu:~$ sudo -H python3 install.py --production --user def_user
    Logs are saved under /tmp/logs/easy-install__2020-01-10__17-24.log
    Checking System Compatibility...
    ubuntu 18 is compatible!
    curl already installed!
    wget already installed!
    git already installed!
    pip3 already installed!
     [WARNING]: No inventory was parsed, only implicit localhost is available
     [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
    localhost does not match 'all'
    Input MySQL and Frappe Administrator passwords:
    Passwords saved at ~/passwords.txt
     [WARNING]: No inventory was parsed, only implicit localhost is available
     [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
    localhost does not match 'all'
     [WARNING]: Could not find aptitude. Using apt-get instead

    [WARNING]: Consider using the get_url or uri module rather than running 'curl'.  If you need to use
    command because get_url or uri is insufficient you can add 'warn: false' to this command task or set
    'command_warnings=False' in ansible.cfg to get rid of this message.
    [DEPRECATION WARNING]: evaluating [] as a bare variable, this behaviour will go away and you might 
    need to add |bool to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration 
    toggle.. This feature will be removed in version 2.12. Deprecation warnings can be disabled by 
    setting deprecation_warnings=False in ansible.cfg.
     [WARNING]: Consider using the file module with owner rather than running 'chown'.  If you need to
    use command because file is insufficient you can add 'warn: false' to this command task or set
    'command_warnings=False' in ansible.cfg to get rid of this message.


Must i install aptitude or can i use apt, apt-get?