# Application cookbook, ruby 1.9, rails 3.1.0, mysql gem not getting installed?

**URL:** <https://discourse.chef.io/t/application-cookbook-ruby-1-9-rails-3-1-0-mysql-gem-not-getting-installed/2068>\
**Category:** Chef Infra (archive)\
**Created:** [September 6, 2011, 5:39am UTC](https://discourse.chef.io/t/application-cookbook-ruby-1-9-rails-3-1-0-mysql-gem-not-getting-installed/2068 "2011-09-06T05:39:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denis\_Haskin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/denis_haskin/32/711_2.png) [@Denis\_Haskin](https://discourse.chef.io/u/Denis_Haskin)\
**Post date:** [September 6, 2011, 5:39am UTC](https://discourse.chef.io/t/application-cookbook-ruby-1-9-rails-3-1-0-mysql-gem-not-getting-installed/2068/1 "2011-09-06T05:39:26Z")

</div>

Any assistance would be appreciated–I’m sort of at a loss at this point.

I’ve been doing some hacking on chef and the application cookbook (following  
some good write-ups people have posted on their blogs) and have an EC2 node  
that comes up with ruby 1.9, chef 0.10, rails 3.1.0, etc.

All seems good _except_ that the mysql gem is not getting installed (or not  
getting installed early enough?) and so the process fails when the database  
master role tries to create the database, for which it is apparently using  
the mysql gem (specifically: “INFO: Processing mysql\_database[create  
zmx\_staging] action create\_db (database::master line 84)”).

I check at that point and no, there is no mysql gem. If I install the gem  
manually and then run chef-client, the configuration continues and succeeds.

As far as I can tell, I shouldn’t have to be specifying any of the mysql  
recipes in any of my roles files, nor include the gem in the gems list of  
the apps data bag (since that shouldn’t apply until later).

Suggestions? More info I can provide?

Thanks…

dwh

---

<div class="post-metadata">

**Author:** ![Joshua\_Timberman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joshua_timberman/32/424_2.png) [@Joshua\_Timberman](https://discourse.chef.io/u/Joshua_Timberman)\
**Post date:** [September 6, 2011, 6:29pm UTC](https://discourse.chef.io/t/application-cookbook-ruby-1-9-rails-3-1-0-mysql-gem-not-getting-installed/2068/2 "2011-09-06T18:29:39Z")

</div>

Hello,

On Sep 5, 2011, at 11:39 PM, Denis Haskin wrote:

> All seems good _except_ that the mysql gem is not getting installed (or not  
> getting installed early enough?) and so the process fails when the database  
> master role tries to create the database, for which it is apparently using  
> the mysql gem (specifically: "INFO: Processing mysql\_database[create  
> zmx\_staging] action create\_db (database::master line 84)").

The mysql::client recipe that handles installing the MySQL ruby libraries will install them as a package on debian/ubuntu and redhat-family distros. We should probably make it a gem installation on all platforms because of this particular issue.

To fix, you can replace the if block from line 43-61[0] in the mysql::client recipe with:

gem\_package "mysql" do  
action :install  
end

[0]: in version 1.2.0, the current release on [community.opscode.com](http://community.opscode.com).

--  
Opscode, Inc  
Joshua Timberman, Director of Training and Services  
IRC, Skype, Twitter, Github: jtimberman

---

<div class="post-metadata">

**Author:** ![Denis\_Haskin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/denis_haskin/32/711_2.png) [@Denis\_Haskin](https://discourse.chef.io/u/Denis_Haskin)\
**Post date:** [September 7, 2011, 1:53am UTC](https://discourse.chef.io/t/application-cookbook-ruby-1-9-rails-3-1-0-mysql-gem-not-getting-installed/2068/3 "2011-09-07T01:53:37Z")

</div>

Ah, I _thought_ maybe it was something along those lines, and was poking  
around that file. I wasn't fully understanding it yet, though.  
Thanks--I'll give this a try.

dwh

On Tue, Sep 6, 2011 at 2:29 PM, Joshua Timberman [joshua@opscode.com](mailto:joshua@opscode.com) wrote:

> Hello,
> 
> On Sep 5, 2011, at 11:39 PM, Denis Haskin wrote:
> 
> > All seems good _except_ that the mysql gem is not getting installed (or  
> > not  
> > getting installed early enough?) and so the process fails when the  
> > database  
> > master role tries to create the database, for which it is apparently  
> > using  
> > the mysql gem (specifically: "INFO: Processing mysql\_database[create  
> > zmx\_staging] action create\_db (database::master line 84)").
> 
> The mysql::client recipe that handles installing the MySQL ruby libraries  
> will install them as a package on debian/ubuntu and redhat-family distros.  
> We should probably make it a gem installation on all platforms because of  
> this particular issue.
> 
> To fix, you can replace the if block from line 43-61[0] in the  
> mysql::client recipe with:
> 
> gem\_package "mysql" do  
> action :install  
> end
> 
> [0]: in version 1.2.0, the current release on [community.opscode.com](http://community.opscode.com).
> 
> --  
> Opscode, Inc  
> Joshua Timberman, Director of Training and Services  
> IRC, Skype, Twitter, Github: jtimberman
