RT,我用 vagrant 在本地起了一个基于 Ubuntu14.04 的虚拟机,然后按照《Ubuntu 14.04 上使用 Nginx Passenger 部署 Ruby on Rails》里面的教程一步步的安装,不过 ruby 装得是2.1.4
的版本,然后就卡在了 安装 Passenger 的sudo apt-get install nginx-extras 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:
nginx-extras : Depends: perlapi-5.18.2 but it is not installable
Depends: libperl5.18 (>= 5.18.2) but it is not installable
Recommends: passenger (< 4.0.54) but 1:4.0.53-1~trusty1 is to be installed
E: Unable to correct problems, you have held broken packages.
我刚接触 Ruby&Rails,根据这个错误信息个人推测是缺少了某些依赖,不过不知道需要怎么处理才行,请各位帮忙看看,谢谢!
另外,我在网上看了一些其它的教程,发现有不少都是先通过 gem 安装 passenger,然后再通过passenger-install-nginx-module
来安装一个特殊版本的 nginx 用于和 passenger 一起部署 rails,我也尝试了这个方法,首先用apt-get remove
卸载了之前安装的 nginx,然后通过passenger-install-nginx-module
顺利安装,但是在启动 Nginx 的时候就遇到了另外一个问题:
#passenger及nginx配置信息
# Passenger的根目录
# passeger-config --root >>>
/home/vagrant/.rvm/gems/ruby-2.1.4/gems/passenger-4.0.53
# nginx安装目录 /opt/nginx/
# vim /opt/nginx/conf/nginx.conf >>>
http {
passenger_root /home/vagrant/.rvm/gems/ruby-2.1.4/gems/passenger-4.0.53;
passenger_ruby /home/vagrant/.rvm/gems/ruby-2.1.4/wrappers/ruby;
...
报错提示:
nginx: [emerg] unknown directive "passenger_root" in /etc/nginx/nginx.conf:18
请问,这个问题又改如何破呢?
@happypeter 请问能否指导一下,谢谢!