-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrvm.rb
39 lines (32 loc) · 874 Bytes
/
rvm.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This depends on the RVM gem...
#
# gem install rvm
#
# Note that you do not have to install RVM itself via the gem,
# the gem just needs to be present so it can be used here.
#
# Note also that you MUST be using 1.9.2 already on the command
# line when generating your Rails app...
#
# rvm use 1.9.2
# TODO: check prerequisites
unless Gem.available?("rspec", ">= 2.0.0")
run "gem install rvm --no-rdoc --no-ri"
Gem.refresh
Gem.activate("rvm")
end
require 'rvm'
create_file ".rvmrc" do
"rvm 1.9.2@#{app_name}"
end
run "rvm rvmrc trust"
run "rvm use 1.9.2@#{app_name} --create"
run "rvm 1.9.2@#{app_name}"
run "rvm gemset load #{app_name}"
RVM.gemset_use! app_name
# Now install the required gems in the new gemset
unless Gem.available?("rails")
run 'gem install rails --no-rdoc --no-ri'
else
say("Found rails, skipping installation", :cyan)
end