Error while migrating to v5

i tried to install v5 on a fresh machine using this modified easy install script
*frappe and erp branches were v5.0 and bench branch is master.
also i tried to update an existing v4 system to v5 using “$ bench migrate-to-v5” and got the same error.
here is my custom script.

$ sudo bash setup_frappe.sh --setup-production
Installing for debian 7 amd64
In case you encounter an error, you can post on https://discuss.frappe.io
Adding debian mariadb repo
Installing packages for debian. This might take time…
Installing wkhtmltopdf
[ ok ] Stopping MariaDB database server: mysqld.
[ ok ] Starting MariaDB database server: mysqld …
[info] Checking for corrupt, not cleanly closed and upgrade needing tables…
Adding frappe user
Installing frappe-bench
Already using interpreter /usr/bin/python
Cloning into ‘frappe’…
no crontab for frappe
installing frappe
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 9, in
load_entry_point(‘bench==0.1’, ‘console_scripts’, ‘bench’)()
File “/home/frappe/bench-repo/bench/cli.py”, line 55, in cli
bench()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 610, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 590, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 936, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 782, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 416, in invoke
return callback(*args, **kwargs)
File “/home/frappe/bench-repo/bench/cli.py”, line 158, in init
no_auto_update=no_auto_update, frappe_path=frappe_path, frappe_branch=frappe_branch)
File “/home/frappe/bench-repo/bench/utils.py”, line 65, in init
install_apps_from_path(apps_path, bench=path)
File “/home/frappe/bench-repo/bench/app.py”, line 164, in install_apps_from_path
apps = get_apps_json(path)
File “/home/frappe/bench-repo/bench/app.py”, line 173, in get_apps_json
with open(path) as f:
IOError: [Errno 2] No such file or directory: u’file:///home/frappe/erpnext-apps-master.json’
frappe@instance-3:~$

i guess my error is partially related to this post but i am unable to get through