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