This commit is contained in:
BoHung Chiu 2022-11-04 15:15:14 +08:00
parent 455523cb09
commit 8bf121655b
1 changed files with 12 additions and 7 deletions

View File

@ -76,15 +76,20 @@ if bundle_update_flag
require 'nokogiri'
rescue ScriptError => e
if RUBY_VERSION.to_f <= 2.1
system('gem install nokogiri -v 1.7.0.1')
nokogiri_version = '1.7.0.1'
else
system('gem install nokogiri -v 1.8.5')
nokogiri_version = '1.8.5'
end
gem_home = ENV["GEM_HOME"]
if !gem_home.nil?
$LOAD_PATH << "#{gem_home}/gems/nokogiri-1.7.0.1/lib"
$LOAD_PATH << "#{gem_home}/extensions/#{RUBY_PLATFORM}/#{RUBY_VERSION}/nokogiri-1.7.0.1"
require 'nokogiri'
flag = system("gem install nokogiri -v #{nokogiri_version}")
if flag
gem_home = ENV["GEM_HOME"]
if !gem_home.nil?
$LOAD_PATH << "#{gem_home}/gems/nokogiri-#{nokogiri_version}/lib"
$LOAD_PATH << "#{gem_home}/extensions/#{RUBY_PLATFORM}/#{RUBY_VERSION}/nokogiri-#{nokogiri_version}"
require 'nokogiri'
end
else
next
end
end
puts "changing header.html.erb in #{folder}/home/header.html.erb"