# Cookbook compile issue when using 'postgresql::ruby'

**URL:** <https://discourse.chef.io/t/cookbook-compile-issue-when-using-postgresql-ruby/6425>\
**Category:** Chef Infra (archive)\
**Created:** [March 19, 2015, 5:20am UTC](https://discourse.chef.io/t/cookbook-compile-issue-when-using-postgresql-ruby/6425 "2015-03-19T05:20:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cooper\_Simmons](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cooper_simmons/32/141_2.png) [@Cooper\_Simmons](https://discourse.chef.io/u/Cooper_Simmons)\
**Post date:** [March 19, 2015, 5:20am UTC](https://discourse.chef.io/t/cookbook-compile-issue-when-using-postgresql-ruby/6425/1 "2015-03-19T05:20:43Z")

</div>

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

> <https://github.com/sous-chefs/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? 🙂

Thanks,  
Cooper

---

<div class="post-metadata">

**Author:** ![Cooper\_Simmons](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/cooper_simmons/32/141_2.png) [@Cooper\_Simmons](https://discourse.chef.io/u/Cooper_Simmons)\
**Post date:** [March 22, 2015, 2:56am UTC](https://discourse.chef.io/t/cookbook-compile-issue-when-using-postgresql-ruby/6425/2 "2015-03-22T02:56:26Z")

</div>

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](mailto: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](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:  
> [postgresql::ruby failing during cookbook compiliation - full error output · GitHub](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? 🙂
> 
> Thanks,  
> Cooper
