jnewland (owner)

Forks

Revisions

  • e10165 jnewland Mon Aug 17 12:07:02 -0700 2009
  • b81824 Jesse N... Mon Aug 17 11:40:37 -0700 2009
  • 7a59ea jnewland Thu Aug 13 05:59:12 -0700 2009
  • c3ea23 jnewland Thu Aug 13 05:57:18 -0700 2009
  • fd2893 jnewland Thu Aug 13 05:56:22 -0700 2009
  • 363079 jnewland Thu Aug 13 05:53:09 -0700 2009
gist: 167155 Download_button fork
public
Public Clone URL: git://gist.github.com/167155.git
Embed All Files: show embed
ree_gem_reinstall.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
40
#!/opt/ree/bin/ruby
# originally from http://griffin.oobleyboo.com/archive/ruby-enterprise-edition-gem-install-script/
#
# Usage:
#
# $ sudo -s
# # OLD_GEM=/usr/bin/gem NEW_GEM=/opt/ree-whatever/bin/gem /opt/ree/bin/ruby ree_gem_reinstall.rb
 
# The command to run for your vanila Ruby 'gem' command
ENV['OLD_GEM'] ||= '/usr/bin/gem'
# The command to run for REE's 'gem' command
ENV['NEW_GEM'] ||= '/opt/ree/bin/gem'
 
output=`#{ENV['OLD_GEM']} list`
new_list=`#{ENV['NEW_GEM']} list`
output.each do |line|
  # Skip lines that don't look like a gem version
  matches=line.match(/([A-Z].+) \(([0-9\., ]+)\)/i)
  if matches then
    gem_name=matches[1]
    # skip passenger and mysql
    next if gem_name == 'mysql' || gem_name == 'passenger'
    versions=matches[2]
    versions.split(', ').each do |ver|
      cmd="#{ENV['NEW_GEM']} install #{gem_name} -v #{ver} --no-rdoc --no-ri --backtrace"
      # See if this gem is already installed
      if new_list =~ /#{gem_name} \(.*#{ver}.*\)/i then
        puts "#{gem_name} #{ver} is already installed. Skipping"
      else
        puts cmd
        system(cmd)
      end
    end
  end
end
#install mysql
cmd = "#{ENV['NEW_GEM']} install mysql -- --with-mysql-config"
puts cmd
system(cmd)
puts "Done!"