0

I'm working on a project which requires Unicorn to run. I have set up a service which will start on boot. However, it fails to start. Here is an excerpt from the log with the errors:

jul 05 08:21:04 ubuntu3 su[1255]: pam_systemd(su:session): Failed to create session: Connection timed out
jul 05 08:21:06 ubuntu3 unicorn_consul[1116]: ruby-2.3.2 is not installed.
jul 05 08:21:06 ubuntu3 unicorn_consul[1116]: To install do: 'rvm install ruby-2.3.2'

I do have Ruby installed, if I run ruby -v it returns ruby 2.3.2p217 (2016-11-15 revision 56796) [i686-linux]. Is it maybe because I installed Ruby via rbenv instead of rvm? If so, how can I make it use my Ruby installation?

Here I pasted the contents of my service's bash file.

Then I'd start Nginx. Here are the contents of its config file.

UPDATE 1:

I fixed the Ruby problem when I uninstalled rvm from my computer. Now the only problem left is the timeout problem.

  • How are you running the rails server? – aBadAssCowboy Jul 05 '17 at 07:59
  • Sorry, I forgot the last part. I start it with Nginx. I use `sudo service nginx restart` and it would be ready, but it isn't. I tried with another Rails app and it worked. I edited the post. –  Jul 05 '17 at 08:12
  • I fixed the Ruby problem, now the only thing that is left is the timeout problem. –  Jul 06 '17 at 06:52

1 Answers1

0

I finally managed to run the service. Here is what I did:

The first problem was the service timeout. I edited my config/unicorn.rb file and I changed the timeout from 30 to 120.

The second problem was Ruby not being found despite having it installed. I solved it by uninstalling rvm (aside from running rvm implode I had to delete some files, folders and references in other files).