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,16 +76,21 @@ 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
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-1.7.0.1/lib"
$LOAD_PATH << "#{gem_home}/extensions/#{RUBY_PLATFORM}/#{RUBY_VERSION}/nokogiri-1.7.0.1"
$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"
if folder.split('/')[-1] != 'mobile'