Forem Creators and Builders 🌱

Cover image for Installing Forem on Ubuntu 18.04 (Part 7 - Forem)
Dawood Khan Masood
Dawood Khan Masood

Posted on • Updated on

Installing Forem on Ubuntu 18.04 (Part 7 - Forem)

If there is anything you would like me to change, please comment. This section of the guide assumes you have already installed Elastic Search from the previous article.

An Alt Text

Prerequisites

Update your package lists by typing:

$ sudo apt-get update
Enter fullscreen mode Exit fullscreen mode

Install the development version of libcurl4 by typing:

$ sudo apt-get install libcurl4 libcurl4-openssl-dev -y
Enter fullscreen mode Exit fullscreen mode

Installing Forem

Clone 'Forem' from the source repository into '~/forem' by typing:

$ git clone https://github.com/forem/forem.git ~/forem
$ cd ~/forem
Enter fullscreen mode Exit fullscreen mode

Install bundler by typing:

$ gem install bundler
Enter fullscreen mode Exit fullscreen mode

Create 'application.yml' from the sample template (sample_application.yml). To do so, type:

$ cp .env_sample .env
Enter fullscreen mode Exit fullscreen mode

Run the ruby 'setup' file:

$ bin/setup
Enter fullscreen mode Exit fullscreen mode

Verify Forem is installed by typing:

$ bin/startup
Enter fullscreen mode Exit fullscreen mode

The output will be something like this:

== STARTING UP ==
14:05:32 web.1       | started with pid 68343
14:05:32 webpacker.1 | started with pid 68344
14:05:32 sidekiq.1   | started with pid 68345
14:05:37 webpacker.1 | ℹ 「wds」: Project is running at http://0.0.0.0:3035/
14:05:37 webpacker.1 | ℹ 「wds」: webpack output is served from /packs/
14:05:37 webpacker.1 | ℹ 「wds」: Content not from webpack is served from /home/hackhex/forem/public/packs
14:05:37 webpacker.1 | ℹ 「wds」: 404s will fallback to /index.html
Enter fullscreen mode Exit fullscreen mode

Oldest comments (6)

Collapse
 
akhil profile image
Akhil Naidu

Create 'application.yml' from the sample template (sample_application.yml). To do so, type:

cp ./config/sample_application.yml ./config/application.yml This command has been updated to cp .env_sample .env in the Forem documentation.

So try to check it and if required update this guide accordingly. I updated it in Forem in Docker Guide, to stay authentic to Forem guide.

Collapse
 
avalerionv profile image
Dawood Khan Masood

Missed that part! Thank you for the correction. :)

Collapse
 
madhan profile image
Madhan • Edited

Hi Akhil,

When i run the cmd "bin/setup" i am getting below error,

**ubuntu@ip-172-31-22-238:~/forem$ bin/setup
== Installing dependencies ==
The Gemfile's dependencies are satisfied
Successfully installed foreman-0.87.2
Parsing documentation for foreman-0.87.2
Done installing documentation for foreman after 0 seconds
1 gem installed
Yarn executable was not detected in the system.
Download Yarn at yarnpkg.com/en/docs/install

== Copying sample files ==

== Initializing the application ==

== Preparing database ==
rails aborted!
ActiveRecord::ConnectionNotEstablished: fe_sendauth: no password supplied
/home/ubuntu/forem/bin/rails:5:in <top (required)>'
/home/ubuntu/forem/bin/spring:10:in
require'
/home/ubuntu/forem/bin/spring:10:in block in <top (required)>'
/home/ubuntu/forem/bin/spring:7:in
'

Caused by:
PG::ConnectionBad: fe_sendauth: no password supplied
/home/ubuntu/forem/bin/rails:5:in <top (required)>'
/home/ubuntu/forem/bin/spring:10:in
require'
/home/ubuntu/forem/bin/spring:10:in block in <top (required)>'
/home/ubuntu/forem/bin/spring:7:in
'
Tasks: TOP => db:prepare
(See full trace by running task with --trace)

== Command ["bin/rails app_initializer:setup forem:setup"] failed ==**

Collapse
 
mercy_thuyle profile image
WhiTExB3AR • Edited

Hi @madhan
I also stuck like you with error

`rails aborted!
ActiveRecord::ConnectionNotEstablished: fe_sendauth: no password supplied

Caused by:
PG::ConnectionBad: fe_sendauth: no password supplied

Tasks: TOP => db:prepare
(See full trace by running task with --trace)

== Command ["bin/rails app_initializer:setup forem:setup"] failed ==`

Did you know how to fix? I really need help.

Collapse
 
mercy_thuyle profile image
WhiTExB3AR • Edited

Hi @avalerionv and @madhan
I fixed, I edited the .env with user, password and database I created in postgresql like this
DATABASE_NAME="abd"
DATABASE_URL="postgresql://abd:abd@localhost"

anyway, the bin/startup not work, error-log like this:
`~/forem$ bin/startup
== STARTING UP ==
18:22:46 web.1 | started with pid 11077
18:22:46 webpacker.1 | started with pid 11078
18:22:46 sidekiq.1 | started with pid 11079
00h00m00s 0/0: : 18:22:53 webpacker.1 | ERROR: [Errno 21] Is a directory: 'bin'
18:22:54 webpacker.1 | CRITICAL:root:Traceback (most recent call last):
18:22:54 webpacker.1 | File "/usr/lib/python3/dist-packages/cliapp/app.py", line 182, in _run
18:22:54 webpacker.1 | self.settings.load_configs()
18:22:54 webpacker.1 | File "/usr/lib/python3/dist-packages/cliapp/settings.py", line 829, in load_configs
18:22:54 webpacker.1 | self._read_ini(pathname, f)
18:22:54 webpacker.1 | File "/usr/lib/python3/dist-packages/cliapp/settings.py", line 838, in _read_ini
18:22:54 webpacker.1 | cp.readfp(f)
18:22:54 webpacker.1 | File "/usr/lib/python3.8/configparser.py", line 763, in readfp
18:22:54 webpacker.1 | self.read_file(fp, source=filename)
18:22:54 webpacker.1 | File "/usr/lib/python3.8/configparser.py", line 718, in read_file
18:22:54 webpacker.1 | self._read(f, source)
18:22:54 webpacker.1 | File "/usr/lib/python3.8/configparser.py", line 1082, in _read
18:22:54 webpacker.1 | raise MissingSectionHeaderError(fpname, lineno, line)
18:22:54 webpacker.1 | configparser.MissingSectionHeaderError: File contains no section headers.
18:22:54 webpacker.1 | file: '/home/ubuntu/forem/config/webpack/development.js', line: 1
18:22:54 webpacker.1 | '/* eslint-env node /\n'
18:22:54 webpacker.1 |
18:22:54 webpacker.1 | Traceback (most recent call last):
18:22:54 webpacker.1 | File "/usr/lib/python3/dist-packages/cliapp/app.py", line 182, in _run
18:22:54 webpacker.1 | self.settings.load_configs()
18:22:54 webpacker.1 | File "/usr/lib/python3/dist-packages/cliapp/settings.py", line 829, in load_configs
18:22:54 webpacker.1 | self._read_ini(pathname, f)
18:22:54 webpacker.1 | File "/usr/lib/python3/dist-packages/cliapp/settings.py", line 838, in _read_ini
18:22:54 webpacker.1 | cp.readfp(f)
18:22:54 webpacker.1 | File "/usr/lib/python3.8/configparser.py", line 763, in readfp
18:22:54 webpacker.1 | self.read_file(fp, source=filename)
18:22:54 webpacker.1 | File "/usr/lib/python3.8/configparser.py", line 718, in read_file
18:22:54 webpacker.1 | self._read(f, source)
18:22:54 webpacker.1 | File "/usr/lib/python3.8/configparser.py", line 1082, in _read
18:22:54 webpacker.1 | raise MissingSectionHeaderError(fpname, lineno, line)
18:22:54 webpacker.1 | configparser.MissingSectionHeaderError: File contains no section headers.
18:22:54 webpacker.1 | file: '/home/ubuntu/forem/config/webpack/development.js', line: 1
18:22:54 webpacker.1 | '/
eslint-env node */\n'
18:22:54 webpacker.1 | exited with code 1
18:22:54 system | sending SIGTERM to all processes
18:22:54 web.1 | terminated by SIGTERM
18:22:54 sidekiq.1 | terminated by SIGTERM

== Command ["foreman start -f Procfile.dev"] failed ==`

Collapse
 
subilan profile image
Yuenleung So

It's somehow misleading to call the process install as it turns out to be a development instance and cannot be used in production.