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.
Prerequisites
Update your package lists by typing:
$ sudo apt-get update
Install the development version of libcurl4 by typing:
$ sudo apt-get install libcurl4 libcurl4-openssl-dev -y
Installing Forem
Clone 'Forem' from the source repository into '~/forem' by typing:
$ git clone https://github.com/forem/forem.git ~/forem
$ cd ~/forem
Install bundler by typing:
$ gem install bundler
Create 'application.yml' from the sample template (sample_application.yml). To do so, type:
$ cp .env_sample .env
Run the ruby 'setup' file:
$ bin/setup
Verify Forem is installed by typing:
$ bin/startup
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
Top comments (6)
cp ./config/sample_application.yml ./config/application.yml
This command has been updated tocp .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.
Missed that part! Thank you for the correction. :)
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)>'
require'/home/ubuntu/forem/bin/spring:10:in
/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)>'
require'/home/ubuntu/forem/bin/spring:10:in
/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 ==**
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.
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 ==`
It's somehow misleading to call the process install as it turns out to be a development instance and cannot be used in production.