简体   繁体   中英

Deploying with Rubber: 'libapache2-mod-passenger' was not found

I am following Ryan Bates's Rails Cast to deploy a Rails app to EC2 with Rubber . Everything seems to go well until this error. How can I fix this?

** [out :: production.foo.com] Ign https://oss-binaries.phusionpassenger.com precise/main Translation-en
** [out :: production.foo.com] Fetched 60.6 kB in 2s (25.7 kB/s)
** [out :: production.foo.com] Reading package lists...
** [out :: production.foo.com] 
** [out :: production.foo.com] Reading package lists...
** [out :: production.foo.com] 
** [out :: production.foo.com] Building dependency tree...
** [out :: production.foo.com] 
** [out :: production.foo.com] Reading state information...
** [out :: production.foo.com] 
** [out :: production.foo.com] E
** [out :: production.foo.com] :
** [out :: production.foo.com] Version '1:4.0.48-1~precise1' for 'libapache2-mod-passenger' was not found
** [out :: production.foo.com] 
command finished in 10387ms
failed: "/bin/bash -l -c 'sudo -p '\\''sudo password: '\\''  bash -l /tmp/install_packages postfix build-essential git-core libxslt-dev ntp postgresql-client libpq-dev subversion curl autoconf bison ruby zlib1g-dev libssl-dev libreadline6-dev libxml2-dev libyaml-dev apache2 libapache2-mod-proxy-html libcurl4-openssl-dev libapache2-mod-xsendfile apache2-mpm-prefork apache2-prefork-dev libapache2-mod-passenger=1:4.0.48-1~`lsb_release -sc`1 collectd libperl-dev monit postgresql-9.1 openjdk-7-jdk unzip python-django python-django-tagging python-cairo python-memcache memcached uwsgi uwsgi-plugin-python uwsgi-plugin-http sqlite3 bzr zip mongodb-10gen haproxy ec2-ami-tools'" on production.foo.com

My rubber.yml :

app_name: My_App

app_user: app

admin_email: "root@#{full_host}"

timezone: US/Western

domain: foo.com

cloud_providers:
  aws:

region: us-west-2

access_key: MYACCESSKEYXX
secret_access_key: secret-keyXX
account: MYACCOUNTXXX

key_name: my-key-file
key_file: "#{Dir[(File.expand_path('~') rescue '/root') + '/.ec2/*' + cloud_providers.aws.key_name].first}"

image_type: t2.micro
image_id: ami-ef5e24df  #this is a Ubuntu 12.04 precise EBS hvm 64-bit 

Tried what was suggested in this question , but didn't help. I tried installing libapache2-mod-passenger in both my local machine and amazon's instance, didn't help.

I am using Ruby 1.9.3 to avoid other problems

结束了在rubber-passenger.yml中将乘客版本从1:4.0.48-1~precise11:4.0.50-1~precise1并解决了问题。

Just an update of it.

You must change in this way:

before

passenger_version: '1:4.0.57-1~`lsb_release -sc`1'

after

passenger_version: '1:5.0.6-1~`lsb_release -sc`1'

What you have to do is just change the number version and get the number version as Derek Hill said

I experienced this same error.

The reason for this problem is expressed by Kevin Menard : “ Passenger has this very annoying behavior of removing packages from their index as soon as a new version is released.

The answer is to update the passenger_version in rubber-passenger.yml , but the question is to what.

The approach that worked for me was obtaining the version from the trusty directory :

  1. Go to https://oss-binaries.phusionpassenger.com/apt/passenger/dists/trusty/main/binary-amd64/Packages
  2. Open the “Packages” file
  3. Find the version of the libapache2-mod-passenger package

In my case that meant updating passenger_version to 1:5.0.5-1~trusty1

I faced the same issue. One by one I tried the version present on above given url

https://oss-binaries.phusionpassenger.com/apt/passenger/dists/trusty/main/binary-amd64/Packages

I found it hectic first and I thought how could I enter all one by one. So I filtered the ones containing keywords "libapache2-mod-passenger" by using chrome ctrl+f search filter, as it highlights the area where this keyword is present.

Fortunately I got this working on this version

'1:5.0.29-1~`lsb_release -sc`1'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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