ruby-on-rails 在debian-10上使用nginx设置乘客

kknvjkwl  于 2023-03-04  发布在  Ruby
关注(0)|答案(5)|浏览(129)

我用debian-10开始我的新服务器安装。
nginx工作正常,由apt install nginx-full安装,但后来,想安装乘客,在这种方式https://www.phusionpassenger.com/library/install/nginx/install/oss/stretch/(巴斯特没有列出),我无法让它运行。

1) sudo apt-get install -y dirmngr gnupg
2) sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-3) keys 561F9B9CAC40B2F7
3) sudo apt-get install -y apt-transport-https ca-certificates

# Add our APT repository
4) sudo sh -c 'echo deb https://oss-5) binaries.phusionpassenger.com/apt/passenger stretch main > /etc/apt/sources.list.d/passenger.list'
5) sudo apt-get update

# Install Passenger + Nginx module
6) sudo apt-get install -y libnginx-mod-http-passenger

=〉在第5步,结果为:

root@33041:/# apt update
Hit:1 http://debian.ethz.ch/debian buster InRelease
Hit:2 http://debian.ethz.ch/debian buster-updates InRelease                                    
Hit:3 http://security.debian.org/debian-security buster/updates InRelease                                          
Ign:4 https://oss-binaries.phusionpassenger.com/apt/passenger stretch InRelease                                    
Hit:5 https://oss-binaries.phusionpassenger.com/apt/passenger stretch Release
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
root@33041:/#

在步骤6中,结果为:

root@33041:/etc/apt# apt install -y libnginx-mod-http-passenger
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libnginx-mod-http-passenger : Depends: passenger (= 1:6.0.2-1~stretch1) but it is not going to be installed
                               Depends: nginx-common (< 1.10.4) but 1.14.2-2+deb10u1 is to be installed
E: Unable to correct problems, you have held broken packages.
root@33041:/etc/apt#

=〉然后我试了

apt install passenger

=〉并获得:

root@33041:/etc/apt# apt install passenger
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 passenger : Depends: libcurl3 (>= 7.16.2) but it is not installable
             Recommends: passenger-doc (= 1:6.0.2-1~stretch1) but it is not going to be installed
             Recommends: passenger-dev (= 1:6.0.2-1~stretch1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@33041:/etc/apt#

问题:
a)有没有人带nginx和passenger来运行debian-10?(我不想从源代码重新编译nginx,比如this
b)如果没有,其他推荐的方法是什么(nginx作为puma的代理..)?
谢谢,克里斯

q8l4jmvw

q8l4jmvw1#

我有完全相同的问题。Phusion Stretch repo与原生buster包冲突,Phusion Buster repo似乎是空的。
我在这里发布了一个bug,暂时没有回复:https://github.com/phusion/passenger/issues/2221

sigwle7e

sigwle7e2#

我学到了:不要使用不到一年的新Linux版本(在我的例子中是Debian)。
为了完成我们的对话:我使用RVM,它做的或多或少和rbenv一样。这不是问题。问题是:MariaDB出现了一个问题,它无法连接到mysql 2-gem。PHP可以连接,但不能连接Rails。这是一个Maria-DB问题,几乎是从v10.1开始的。所以我必须更改我的apt-sources-list-file,以便能够安装mariaDB-10.3。在这里,问题得到了解决。

ui7jx7zq

ui7jx7zq3#

现在,乘客的联合创始人标记了安德的票,我想,他们会在下次交付。
对我来说,我等不及了。
我做了,我以前避免做的事:已删除系统安装的NGINX,并按照this从源代码重新编译。
最后在/opt/下得到一个NGINX,并通过

`nginx -s reload``, ``nginx -s start`, and so on.

它运行得很好,也不是一个坏的解决方案,只是配置和通常的有很大的不同,尤其是php-fpm。
所以,这张票的目的解决了,但是,我有很多其他的问题:使nokogiri(Rails)运行,而且,我不能说为什么-在一个用户的mysql 2-gem无法连接。
所以,在和,在几天的空闲时间后,我切换回debian-9,安装工作,几乎在第一次尝试。

s4n0splo

s4n0splo4#

升级到buster真的很糟糕,我所有的服务都停了,因为mysql,postgres,passenger,owncloud,激进的问题,等等。
对于我来说,我使用了很多独立的版本,所以一个单独的nginx服务器是不可行的。
希望乘客回购书能尽快更新。
对于您的rails问题,在我这边我使用rbenv,以便能够控制我运行的ruby的版本,而不依赖于操作系统更新。

ruarlubt

ruarlubt5#

在Debian 11上,我在这个命令上也有同样的错误

sudo apt-get install libnginx-mod-http-passenger

使用this answer解决

相关问题