class MakeItSo::Rails::PrerequisiteCheck

Public Instance Methods

check() click to toggle source
# File lib/make_it_so/rails/prerequisite_check.rb, line 9
def check
  say "Checking Rails version...", :yellow
  begin
    require "rails"
    puts ::Rails.version
    if ::Rails.version != MakeItSo::Rails::VERSION
      say "Rails versions check FAILED - execute the following", :red 
      say "gem uninstall rails railties activejob actionmailer -a && gem install rails -v #{MakeItSo::Rails::VERSION}"
      return false
    else
      say "Rails version MATCH", :green
      return true
    end
  rescue LoadError => e
    say "Rails not installed", :red
    return false
  end
end