Cookbook compile issue when using 'postgresql::ruby'


#1

I am trying to get the ruby recipe working in the hw postgresql cookbook.
We are currently using v3.4.16:

The run list for the node looks like this when I run knife ec2 server
create:
“role[base-dw-aws],recipe[yum-pgdg],role[db-postgresql]”

I have in the db-postgresql role:
“run_list”: [
“recipe[dw-server-postgresql::pg-install]”
]

Inside the pg-install recipe I have:
include_recipe 'postgresql::client’
include_recipe 'postgresql::server’
include_recipe ‘postgresql::ruby’

This fails during cookbook compilation:
"No version specified, and no candidate version available for postgresql94"
Here is the full trace output:

The chef run completes fine without error if I just remove “include_recipe
’postgresql::ruby’” and fails every time with “No version specified, and no
candidate version available for postgresql94” when ‘postgresql::ruby’ is
included.

I’m confused b/c of course ‘recipe[yum-pgdg]’ has not yet run when the run
fails so there really is no postgresql94 candidate available. But the run
is failing during compiling the cookbooks, not during the run.
How does this happen and how can I get it working? :slight_smile:

Thanks,
Cooper


#2

For anyone who encounters this issue in the future…
yum-pgdg was being used to pull in a repo for PostgreSQL v9.4 before I
started adding the functionality of the ‘postgresql::ruby’ recipe.

When I removed / stopped using yum-pgdg and set
node[‘postgresql’][‘enable_pgdg_yum’] to true and had a working
node[‘postgresql’][‘pgdg’][‘repo_rpm_url’] things were looking much better.

I also had to set up yum to install gcc during cookbook compilation:
yum_package ‘gcc’ do
action :nothing
end.run_action :install

Hope this helps someone.
Thanks,
Cooper

On Thu, Mar 19, 2015 at 12:20 AM, Cooper Simmons cooper.simmons@gmail.com
wrote:

I am trying to get the ruby recipe working in the hw postgresql cookbook.
We are currently using v3.4.16:
https://github.com/hw-cookbooks/postgresql/blob/v3.4.16/recipes/ruby.rb

The run list for the node looks like this when I run knife ec2 server
create:
“role[base-dw-aws],recipe[yum-pgdg],role[db-postgresql]”

I have in the db-postgresql role:
“run_list”: [
“recipe[dw-server-postgresql::pg-install]”
]

Inside the pg-install recipe I have:
include_recipe 'postgresql::client’
include_recipe 'postgresql::server’
include_recipe ‘postgresql::ruby’

This fails during cookbook compilation:
"No version specified, and no candidate version available for postgresql94"
Here is the full trace output:
https://gist.github.com/senilegenius/628739d5659055a76670

The chef run completes fine without error if I just remove “include_recipe
’postgresql::ruby’” and fails every time with “No version specified, and no
candidate version available for postgresql94” when ‘postgresql::ruby’ is
included.

I’m confused b/c of course ‘recipe[yum-pgdg]’ has not yet run when the run
fails so there really is no postgresql94 candidate available. But the run
is failing during compiling the cookbooks, not during the run.
How does this happen and how can I get it working? :slight_smile:

Thanks,
Cooper