Skip to content

Commit b911974

Browse files
committed
Fixed ruby_rvm recipe
1 parent 574e4fa commit b911974

File tree

7 files changed

+19
-12
lines changed

7 files changed

+19
-12
lines changed

Vagrantfile.centos

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Vagrant.configure("2") do |config|
4343
}
4444
}
4545

46+
chef.add_recipe "rvm::vagrant" # Resolves "rvm: command not found" and "Could not find chef"
4647
chef.add_recipe "gitlab::ruby_rvm"
4748
chef.add_recipe "gitlab::default"
4849
chef.add_recipe "gitlab::nginx"

attributes/rvm.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Set a higher default ruby version
2+
default['rvm']['default_ruby'] = "ruby-1.9.3-p429"

metadata.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
77
version "0.2.1"
88

9-
%w{git mysql database redisio build-essential python readline perl xml zlib apt nginx ruby_build}.each do |cookbook|
9+
%w{git mysql database redisio build-essential python readline perl xml zlib apt nginx rvm ruby_build}.each do |cookbook|
1010
depends(cookbook)
1111
end
1212

recipes/gitlab_shell.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
user node['gitlab']['user']
1414
group node['gitlab']['group']
1515
source "gitlab_shell_config.yml.erb"
16-
notifies :run, "execute[gitlab install]", :immediately
16+
notifies :run, "execute[gitlab shell install]", :immediately
1717
end
1818

19-
execute "gitlab install" do
20-
if platform?("amazon")
19+
execute "gitlab shell install" do
20+
if node['gitlab']['rvm_ruby']
2121
command "source /etc/profile.d/rvm.sh && rvm use 1.9.3 && ./bin/install"
2222
else
2323
command "./bin/install"

recipes/redhat.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
include_recipe "yum::epel"
44

5-
%w{libicu-devel patch gcc-c++ readline-devel zlib-devel libffi-devel openssl-devel make autoconf automake libtool bison libxml2-devel libxslt-devel libyaml-devel}.each do |pkg|
6-
package pkg
7-
end
5+
package "libicu-devel"
6+
package "openssl-devel"

recipes/ruby_rvm.rb

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Optional recipe to build a system wide ruby
22
# with https://github.com/fnichol/chef-rvm
33

4-
include_recipe "rvm::default"
5-
6-
rvm_default_ruby "1.9.3" do
7-
action :create
4+
# Otherwise libyaml-devel is unavailable
5+
if platform?("redhat", "centos", "fedora", "amazon")
6+
include_recipe "yum::epel"
87
end
98

9+
include_recipe "rvm::system"
10+
rvm_gem "chef"
1011
rvm_gem "bundler"
12+
13+
node.set['gitlab']['rvm_ruby'] = true

templates/default/init_gitlab.erb

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
<% if node.platform?("centos","redhat","fedora","amazon") -%>
1818
# Include RedHat function library
1919
. /etc/rc.d/init.d/functions
20-
# Source RVM as the yum-installable ruby is too old
20+
<% end -%>
21+
<% if node['gitlab']['rvm_ruby'] -%>
22+
# Source RVM
2123
source /etc/profile.d/rvm.sh
2224
rvm use 1.9.3
2325
<% end -%>

0 commit comments

Comments
 (0)