Note: Please go to to access the current RightScale documentation set.
Home > FAQs > How can I generate the metadata.json file from metadata.rb?

How can I generate the metadata.json file from metadata.rb?

Background Information

You have made changes to your Chef cookbook in the metadata.rb file and need to generate or regenerate metadata.json.


Important! As of the 2013-10-01 Dashboard release you no longer have to manually generate a cookbook's metadata.json file because RightScale automatically creates the metadata.json file (from the metadata.rb file) upon a fetch or refetch of your cookbooks into Repose. See Chef Metadata for more technical details.  


There are two tools to facilitate this process—knife or rake. Using knife is the preferred method.

Update Metadata with Knife (Preferred Method)

Knife is included in the chef RubyGem. You can still install Chef without configuring the node for chef-client or chef-server to obtain knife:

gem install chef

Re-generate metadata.json by pointing to the cookbooks path and specifying the cookbook to update.
This example updates a cookbook called "munchies" residing in ~/chef-cookbooks/cookbooks:

knife cookbook metadata munchies -o ~/chef-cookbooks/cookbooks

For more information on how you can use Knife to manage your cookbooks, run the command knife --help.

Update Metadata with Rake (Additional Method)

Chef comes with a metadata Rake task to generate the metadata.json file.

In your Chef repository, run the following command to update the metadata.json for all cookbooks:

rake metadata

 Or, use the cookbook parameter to target a specific cookbook (e.g., db_mysql):

rake metadata cookbook=db_mysql

This is a Ruby command and requires that the rake RubyGem is installed. To install the rake gem, run the following command:

gem install rake


You must to post a comment.
Last modified
08:40, 2 Oct 2013



This page has no classifications.



Glossary | 用語용어 Site Map | Site Help Community Corporate Site Get Support Dashboard Login
Doc Feedback Product Feedback Resources MultiCloud Marketplace Forums

Dashboard Status

© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.