简体   繁体   English

独角兽服务无法在Ubuntu 16.10上启动

[英]Unicorn service failing to start on Ubuntu 16.10

I'm working on a project which requires Unicorn to run. 我正在一个需要Unicorn运行的项目。 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] . 我确实安装了Ruby,如果我运行ruby -v它会返回ruby 2.3.2p217 (2016-11-15 revision 56796) [i686-linux] Is it maybe because I installed Ruby via rbenv instead of rvm? 可能是因为我通过rbenv而不是rvm安装了Ruby吗? If so, how can I make it use my Ruby installation? 如果是这样,如何使用Ruby安装?

Here I pasted the contents of my service's bash file. 在这里,我粘贴了服务的bash文件的内容。

Then I'd start Nginx. 然后,我将启动Nginx。 Here are the contents of its config file. 是其配置文件的内容。

UPDATE 1: 更新1:

I fixed the Ruby problem when I uninstalled rvm from my computer. 当我从计算机上卸载rvm时,我解决了Ruby问题。 Now the only problem left is the timeout problem. 现在剩下的唯一问题是超时问题。

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. 我编辑了config/unicorn.rb文件,并将超时从30更改为120。

The second problem was Ruby not being found despite having it installed. 第二个问题是尽管已安装Ruby,但仍找不到它。 I solved it by uninstalling rvm (aside from running rvm implode I had to delete some files, folders and references in other files). 我通过卸载rvm解决了这一问题(除了运行rvm implode之外,我还必须删除一些文件,文件夹和其他文件中的引用)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM