Ok let me start over here, I was using another rbenv that is differrent from fnichol's cookbook.In my cookbooks I have rbenv (fnichols) and ruby_build (also fnichols), I just downloaded the zip and put it in my /cookbooks (is that ok or do I have to build it?)/cookbook/rbenv/cookbook/ruby_build1. base.rb role:run_list ... "recipe[ruby_build]", "recipe[my_ruby]"2. my_rubymetadata.rb:depends "rbenv"recipes/default.rb:include_recipe "rbenv::system"include_recipe "rbenv::ruby_build"rbenv_ruby "1.9.3" doruby_version "1.9.3-p194"global trueendrbenv_gem "bundler" doruby_version "1.9.3-p194"endrbenv_gem "rubygems" doruby_version "1.9.3-p194"endNow when I run it I get this error:2013-02-24T22:16:51+00:00] FATAL: Chef::Exceptions::RecipeNotFound: could not find recipe ruby_build for cookbook rbenv
On Sun, Feb 24, 2013 at 3:48 PM, AJ Christensen < " target="_blank"> > wrote:
You'll want 'recipe[rbenv::system_install]' and any appropriate $PATH
modifications via /etc/profile.d -- can be a file/contents; make use
of the LWRP 'rbenv_global' [0]
As I mentioned previously, a node attribute hash-map like this suits:
node.default['my_org_rbenv']['system_rubygems']['1.9.3-p194'] = {
bundler: {
version: '1.2.3',
action: 'install',
}
}
system_ruby_version = node['my_org_rbenv']['system_ruby_version']
rbenv_global system_ruby_version
node['my_org_rbenv']['system_rubygems'][system_ruby_version].each do
|gem, params|
rbenv_gem gem do
rbenv_version systemruby
version params['version']
action params['action'].to_sym
end
end
Note that this only reduces repetition and is not required at all.
Cheers,
AJ
[0] rbenv LWRPs: https://github.com/fnichol/chef-rbenv#lwrps
On 25 February 2013 07:10, S Ahmed < " target="_blank"> > wrote:
> thanks, looks like I got most of it.
>
> 1. How do I set it as global (system wide, not user specific?):
> default.rb:
>
> include_recipe "rbenv::default"
> include_recipe "rbenv::ruby_build"
>
> rbenv_ruby "1.9.3-p194"
>
> After my chef-solo ran, I get this when doing: ruby
>
> rbenv: ruby: command not found
>
> The `ruby' command exists in these Ruby versions:
> 1.9.3-p194
>
>
> 2. if I want to install more gems, I have to keep repeating this or like you
> said put it in a each loop right?
>
> rbenv_gem "bundler" do
> ruby_version "1.9.3-p194"
> end
>
> rbenv_gem "rubygems" do
> ruby_version "1.9.3-p194"
> end
>
> ..
> ..
>
>
>
> On Mon, Feb 18, 2013 at 4:17 PM, AJ Christensen < " target="_blank"> > wrote:
>>
>> Oh, as for gems: toss 'em in an attribute, map the attribute into
>> gem_package resources after rbenv is installed and activated so that
>> gem_package goes to the correct VM.
>>
>> Cheers,
>>
>> AJ
>>
>> On 19 February 2013 10:14, AJ Christensen < " target="_blank"> > wrote:
>> > Create a cookbook "myorg_system_wide_ruby" and add the rbenv 'related
>> > code' you mentioned in there.
>> >
>> > depends goes into metadata.rb, the rest in a recipe
>> >
>> > Cheers,
>> >
>> > AJ
>> >
>> > On 19 February 2013 10:11, S Ahmed < " target="_blank"> > wrote:
>> >> Thanks to your suggestions, I am going to use rbenv to manage my
>> >> servers
>> >> system wide ruby and gems setup.
>> >>
>> >> From the readme it seems to alude to using rbenv as dependancy to a
>> >> cookbook, but I want to setup a system wide (default) ruby and
>> >> rubygems.
>> >>
>> >> Does this mean I have to put this in my role_name.rb file? (I'm using
>> >> chef-solo).
>> >>
>> >> My current base.rb is:
>> >>
>> >> name 'base'
>> >> description 'base role that all nodes will have'
>> >> run_list "recipe[build-essential]", "recipe[ohai]", "recipe[runit]",
>> >> "recipe[yum]", "recipe[openssl]", "recipe[git]", "recipe[apt]",
>> >> "recipe[java]"
>> >>
>> >> So do I put rbenv related code in here like:
>> >>
>> >> depends 'rbenv'
>> >>
>> >> include_recipe "rbenv::default"
>> >> include_recipe "rbenv::ruby_build"
>> >>
>> >> rbenv_ruby "1.9.3-p194"
>> >>
>> >> rbenv_gem "bundler" do
>> >> ruby_version "1.9.3-p194"
>> >> end
>> >>
>> >>
>> >> How can I create a list of gems I want pre-installed for default ruby
>> >> to be
>> >> able to access?
>
>
Archive powered by MHonArc 2.6.16.