Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 10: Provisioning of Rails app fails #429

Open
c3er opened this issue Dec 13, 2021 · 3 comments
Open

Chapter 10: Provisioning of Rails app fails #429

c3er opened this issue Dec 13, 2021 · 3 comments

Comments

@c3er
Copy link

c3er commented Dec 13, 2021

If I try the example Vagrantfile of the Rails deployment example, it fails at the task "geerlingguy.passenger : Add Phusion apt repo." with the message "apt cache update failed".

Below, an excerpt of the Vagrant/Ansible output. vagrant up failed with the same error before. This excerpt also includes a deprecation warning for the task "geerlingguy.nodejs : Add npm_config_prefix bin directory to global $PATH".

$ vagrant provision

[...]

TASK [geerlingguy.nodejs : Add npm_config_prefix bin directory to global $PATH.] ***
[DEPRECATION WARNING]: evaluating 'nodejs_generate_etc_profile' as a bare 
variable, this behaviour will go away and you might need to add |bool to the 
expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle. 
This feature will be removed in version 2.12. Deprecation warnings can be 
disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [default]

[...]

TASK [geerlingguy.passenger : Add Passenger apt key.] **************************
ok: [default]

TASK [geerlingguy.passenger : Add apt HTTPS capabilities.] *********************
ok: [default]

TASK [geerlingguy.passenger : Add Phusion apt repo.] ***************************
fatal: [default]: FAILED! => {"changed": false, "msg": "apt cache update failed"}

PLAY RECAP *********************************************************************
default                    : ok=24   changed=0    unreachable=0    failed=1    skipped=30   rescued=0    ignored=0   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

My operating system is Ubuntu 20.04
My VirtualBox version is Version 6.1.26

@matmartin
Copy link

I had the same problem.

See also the issue Keyserver Timeout for the Ansible role geerlingguy.passenger.

I have therefore made the following local changes to the geerlingguy.passenger role:

# Passenger repository setup.
- name: Add Passenger apt key.
  apt_key:
    keyserver: hkp://keyserver.ubuntu.com:80
    id: 561F9B9CAC40B2F7
    state: present

- name: Update ca-certificates package.
  apt: name=ca-certificates state=latest update_cache=yes

- name: Add apt HTTPS capabilities.
  apt: name=apt-transport-https state=present

After modifying the keyserver and adding the task to update the ca-certificates package, it worked again.

@geerlingguy
Copy link
Owner

I'm going to be working on this example a little bit today, too...

@geerlingguy
Copy link
Owner

Gah... fix one thing, two others break.

rake aborted!
NoMethodError: undefined method `new' for BigDecimal:Class
/opt/demo-rails-app/vendor/bundle/ruby/2.7.0/gems/activesupport-4.2.11/lib/active_support/core_ext/object/duplicable.rb:111

I'm going to have to work on revamping the entire https://github.com/geerlingguy/demo-rails-app setup again, for Ruby 2.7.x (or maybe redo it entirely for the latest versions of Ruby and Rails...), because trying to get the dependency chain working with a demo app that has multiple versions and each version has a Gemfile.lock tied to a specific Ruby/Bundler version... it's definitely a new form of dependency hell :P

For now I'm going to leave the example mostly intact, but still bump the Ruby version I install in the example. I'll have to revisit this example so CI can pass again, but for now I'm going to pause the CI testing for this playbook example :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants