After updating the code cloud blog, I want to test locally. Last updated warehouse two years ago, and this broke a bunch of questions, refer to the online article resolved.
An error
% jekyll serve
zsh: /usr/local/bin/jekyll: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory
View ruby version
% ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
First, update jekyll
sudo gem install bundler jekyll
Also installed a lot of things.
The new error
% jekyll serve
Traceback (most recent call last):
12: from /usr/local/bin/jekyll:23:in `<main>'
11: from /usr/local/bin/jekyll:23:in `load'
10: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>'
9: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler.rb:107:in `setup'
7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:20:in `setup'
6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:108:in `block in definition_method'
5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:226:in `requested_specs'
4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:237:in `specs_for'
3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:170:in `specs'
2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `materialize'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:85:in `map!'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/spec_set.rb:91:in `block in materialize': Could not find public_suffix-3.0.2 in any of the sources (Bundler::GemNotFound)
Update bundle. Very slow, I thought the card was dead. To lose the intermediate code.
Too slow, because Gemfile.lock write died gem of sources:
GEM
remote: https://rubygems.org/
Change image
$ bundle config mirror.https://rubygems.org https://gems.ruby-china.com
End change mirror is completed rapidly escalate
% bundle update
Or error
% jekyll serve
Traceback (most recent call last):
10: from /usr/local/bin/jekyll:23:in `<main>'
9: from /usr/local/bin/jekyll:23:in `load'
8: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/exe/jekyll:11:in `<top (required)>'
7: from /Library/Ruby/Gems/2.6.0/gems/jekyll-4.0.0/lib/jekyll/plugin_manager.rb:52:in `require_from_bundler'
6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler.rb:107:in `setup'
5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:26:in `setup'
4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:26:in `map'
3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `each'
2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/forwardable.rb:230:in `each'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:31:in `block in setup'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/runtime.rb:319:in `check_for_activated_spec!': You have already activated i18n 1.8.2, but your Gemfile requires i18n 0.9.5. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
Solution:
Plus bundle exec
, run successfully
% bundle exec jekyll serve
Configuration file: /Users/luojinrong/code/GitHub/obarong.github.io/_config.yml
Source: /Users/luojinrong/code/GitHub/obarong.github.io
Destination: /Users/luojinrong/code/GitHub/obarong.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 0.708 seconds.
Auto-regeneration: enabled for '/Users/luojinrong/code/GitHub/obarong.github.io'
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
Second, upgrade the local version of warehouses with Jekyll (you can skip this section)
Check the error before Jekyll version will appear in the repository directory, go no Gemfile directory.
% jekyll -v
jekyll 4.0.0
In actual use the repository directory 3.8.6
% bundle exec jekyll -v
jekyll 3.8.6
Modify Gemfile
gem "jekyll", "~> 4.0.0"
Update
% bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/..
You have requested:
jekyll ~> 4.0.0
The bundle currently has jekyll locked at 3.8.6.
Try running `bundle update jekyll`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
% bundle update jekyll
Successful upgrade Jekyll warehouse. Oh, to direct the implementation of jekyll serve
the.
Third, the local use GitHub pages topic
Why display GitHub pages of the local better than me?
Modify Gemfile
#gem "jekyll", "~> 4.0.0"
……
gem "github-pages", group: :jekyll_plugins
An error
% bundle update github-pages
Could not find gem 'github-pages'.
solution:
% sudo gem install github-pages
install and update go from
% bundle update
This time the local browser exactly the same effect with GitHub, but to add bundle exec
start.
reference
Jekyll solve the problem because macOS High Sierra updates to Ruby 2.3 can not be started due to a | large column
https://www.dazhuanlan.com/2019/08/21/5d5c525c9e454/
bundle install non-response problem | large column
https://www.dazhuanlan.com/2020/01/07/5e142e02df589/
Personal blog to build step by step to create one blog home use Github Page (2) | large column
https://www.dazhuanlan.com/2020/02/02/5e366f389c663/