?xml version="1.0" encoding="UTF-8"?
系统mac
首先是各种尝试
尝试直接用Github desktop客户端下载链接xlicent里有国内快速下载链接,或直接在github网站里下载,有一点慢。
我想做个可以自动同步的博客
但是网上搜到的资料都是要么直接clone一个别人的模板然后改等等的教程,不适合我这种对定制太多的用户
于是继续折腾,
网上说用jeklly+GitHub
于是就装jeklly
我们来到官网http://jekyll.com.cn/
?xml version="1.0" encoding="UTF-8"?
然后就照着这个在终端里输入
结果就出现
gxl:~ guoxiaoliang$ gem install jekyll
Fetching: public_suffix-3.0.0.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
这tm什么鬼
还有的地方https://jekyllrb.com/说打 gem install jeklly bundler
然后
gxl:~ guoxiaoliang$ gem install jekyll bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
无语了,根本不知道什么意思,这时候又百度,说可能是gem国内不能用的问题
$ gem sources--remove https://rubygems.org/
$ gem sources-a https://ruby.taobao.org/
$ gem sources-l
***CURRENT SOURCES***
https://ruby.taobao.org
然后终于看到一个按着教程走下去的结果了,想想还是挺美好的
接着我们开始gem
gxl:~ guoxiaoliang$ gem install jekyll
Fetching: public_suffix-3.0.0.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
gxl:~ guoxiaoliang$ gem install jekyll bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
妈卖批,还是不行
万念俱灰呀,
,,,,,,过了一天
突然发现是不是别的东西没装好直接装这个所以装不了,于是先装个ruby吧
gxl:~ guoxiaoliang$ sed -i .bak -E 's!https?://cache.ruby-lang.org/pub/ruby!https://ruby.taobao.org/mirrors/ruby!' $rvm_path/config/d
sed: /Users/guoxiaoliang/Desktop/GXG/.rvm/config/d: No such file or directory
gxl:~ guoxiaoliang$ curl -Lhttps://get.rvm.io| bash -s stable
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 194 100 194 0 0 95 0 0:00:02 0:00:02 --:--:-- 95
100 24090 100 24090 0 0 7318 0 0:00:03 0:00:03 --:--:-- 32554
Downloadinghttps://github.com/rvm/rvm/archive/1.29.3.tar.gz
Downloadinghttps://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc
Found PGP signature at: 'https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc',
but no GPG software exists to validate it, skipping.
Upgrading the RVM installation in /Users/guoxiaoliang/Desktop/GXG/.rvm/
RVM PATH line found in /Users/guoxiaoliang/Desktop/GXG/.mkshrc /Users/guoxiaoliang/Desktop/GXG/.profile /Users/guoxiaoliang/Desktop/GXG/.bashrc /Users/guoxiaoliang/Desktop/GXG/.zshrc.
RVM sourcing line found in /Users/guoxiaoliang/Desktop/GXG/.profile /Users/guoxiaoliang/Desktop/GXG/.bash_profile /Users/guoxiaoliang/Desktop/GXG/.zlogin.
Upgrade of RVM in /Users/guoxiaoliang/Desktop/GXG/.rvm/ is complete.
Upgrade Notes:
* No new notes to display.
咦,怎么又和教程不一样!
然后换了种方式
gxl:~ guoxiaoliang$ curl -sSLhttps://get.rvm.io| bash -s stable
Downloadinghttps://github.com/rvm/rvm/archive/1.29.3.tar.gz
Downloadinghttps://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc
curl: (28) Connection timed out after 30003 milliseconds
Could not download 'https://github.com/rvm/rvm/releases/download/1.29.3/1.29.3.tar.gz.asc'.
curl returned status '28'.
Upgrading the RVM installation in /Users/guoxiaoliang/Desktop/GXG/.rvm/
RVM PATH line found in /Users/guoxiaoliang/Desktop/GXG/.mkshrc /Users/guoxiaoliang/Desktop/GXG/.profile /Users/guoxiaoliang/Desktop/GXG/.bashrc /Users/guoxiaoliang/Desktop/GXG/.zshrc.
RVM sourcing line found in /Users/guoxiaoliang/Desktop/GXG/.profile /Users/guoxiaoliang/Desktop/GXG/.bash_profile /Users/guoxiaoliang/Desktop/GXG/.zlogin.
Upgrade of RVM in /Users/guoxiaoliang/Desktop/GXG/.rvm/ is complete.
Upgrade Notes:
* No new notes to display.
还是不行,又换了种方法,这个是通过rvm的方式
知道这个后我按教程先看看rvm有没有,于是,
gxl:~ guoxiaoliang$ rvm -v
rvm 1.29.3 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]
可以,这很舒服。
于是又看了下ruby,(备注下,我是从这里才知道要用-v看下搜索电脑里有没有这个这个软件的)
gxl:~ guoxiaoliang$ ruby -v
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
我去,发现没什么问题呀,和教程一样都是两行,仔细一看又有点不一样呀,于是从我的直角判读这里肯定不是很对,
然后我又去百度,然后发现了这样一个帖子http://blog.csdn.net/zhaoen95/article/details/51995520关于IOS新手在安装cocoa pods失败,因为ruby版本过低的解决方法+ (void) {升级ruby}
于是,我到现在才知道是我电脑ruby版本有点低呀,要升级ruby
划重点,所以搞这个之前,一定要会用-v检查目前电脑已有的东西和版本。痛的领悟
gxl:~ guoxiaoliang$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.7]
[ruby-]2.3[.4]
[ruby-]2.4[.1]
ruby-head
# for forks use: rvm install ruby-head-<name> --urlhttps://github.com/github/ruby.git--branch 2.2
# JRuby
jruby-1.6[.8]
jruby-1.7[.27]
jruby[-9.1.13.0]
jruby-head
# Rubinius
rbx-1[.4.3]
rbx-2.3[.0]
rbx-2.4[.1]
rbx-2[.5.8]
rbx-3[.84]
rbx-head
# Opal
opal
# Minimalistic ruby implementation - ISO 30170:2012
mruby-1.0.0
mruby-1.1.0
mruby-1.2.0
mruby-1[.3.0]
mruby[-head]
# Ruby Enterprise Edition
ree-1.8.6
ree[-1.8.7][-2012.02]
# Topaz
topaz
# MagLev
maglev[-head]
maglev-1.0.0
# Mac OS X Snow Leopard Or Newer
macruby-0.10
macruby-0.11
macruby[-0.12]
macruby-nightly
macruby-head
# IronRuby
ironruby[-1.1.3]
ironruby-head
gxl:~ guoxiaoliang$ rvm install 2.4
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.4.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
About to install Homebrew, press `Enter` for default installation in `/usr/local`,
type new path if you wish custom Homebrew installation (the path needs to be writable for user)
:
-e:161: warning: Insecure world writable dir /Users/guoxiaoliang/Desktop/GXG in PATH, mode 040777
==>This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==>The following existing directories will be made group writable:
/usr/local/bin
==>The following existing directories will have their owner set toguoxiaoliang:
/usr/local/bin
==>The following existing directories will have their group set toadmin:
/usr/local/bin
==>The following new directories will be created:
/usr/local/Cellar
/usr/local/Homebrew
/usr/local/Frameworks
/usr/local/etc
/usr/local/include
/usr/local/lib
/usr/local/opt
/usr/local/sbin
/usr/local/share
/usr/local/share/zsh
/usr/local/share/zsh/site-functions
/usr/local/var
Press RETURN to continue or any other key to abort
==>/usr/bin/sudo /bin/chmod u+rwx /usr/local/bin
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password:
==>/usr/bin/sudo /bin/chmod g+rwx /usr/local/bin
==>/usr/bin/sudo /usr/sbin/chown guoxiaoliang /usr/local/bin
==>/usr/bin/sudo /usr/bin/chgrp admin /usr/local/bin
==>/usr/bin/sudo /bin/mkdir -p /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==>/usr/bin/sudo /bin/chmod g+rwx /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==>/usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==>/usr/bin/sudo /usr/sbin/chown guoxiaoliang /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==>/usr/bin/sudo /usr/bin/chgrp admin /usr/local/Cellar /usr/local/Homebrew /usr/local/Frameworks /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var
==>/usr/bin/sudo /bin/mkdir -p /Users/guoxiaoliang/Desktop/GXG/Library/Caches/Homebrew
==>/usr/bin/sudo /bin/chmod g+rwx /Users/guoxiaoliang/Desktop/GXG/Library/Caches/Homebrew
==>/usr/bin/sudo /usr/sbin/chown guoxiaoliang /Users/guoxiaoliang/Desktop/GXG/Library/Caches/Homebrew
==>/usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew
==>/usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==>/usr/bin/sudo /usr/sbin/chown guoxiaoliang /Library/Caches/Homebrew
==>Downloading and installing Homebrew...
remote: Counting objects: 94386, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 94386 (delta 10), reused 17 (delta 10), pack-reused 94362
Receiving objects: 100% (94386/94386), 21.59 MiB | 2.07 MiB/s, done.
Resolving deltas: 100% (68534/68534), done.
Fromhttps://github.com/Homebrew/brew
* [new branch] master -> origin/master
* [new tag] 0.1 -> 0.1
* [new tag] 0.2 -> 0.2
* [new tag] 0.3 -> 0.3
* [new tag] 0.4 -> 0.4
* [new tag] 0.5 -> 0.5
* [new tag] 0.6 -> 0.6
* [new tag] 0.7 -> 0.7
* [new tag] 0.7.1 -> 0.7.1
* [new tag] 0.8 -> 0.8
* [new tag] 0.8.1 -> 0.8.1
* [new tag] 0.9 -> 0.9
* [new tag] 0.9.1 -> 0.9.1
* [new tag] 0.9.2 -> 0.9.2
* [new tag] 0.9.3 -> 0.9.3
* [new tag] 0.9.4 -> 0.9.4
* [new tag] 0.9.5 -> 0.9.5
* [new tag] 0.9.8 -> 0.9.8
* [new tag] 0.9.9 -> 0.9.9
* [new tag] 1.0.0 -> 1.0.0
* [new tag] 1.0.1 -> 1.0.1
* [new tag] 1.0.2 -> 1.0.2
* [new tag] 1.0.3 -> 1.0.3
* [new tag] 1.0.4 -> 1.0.4
* [new tag] 1.0.5 -> 1.0.5
* [new tag] 1.0.6 -> 1.0.6
* [new tag] 1.0.7 -> 1.0.7
* [new tag] 1.0.8 -> 1.0.8
* [new tag] 1.0.9 -> 1.0.9
* [new tag] 1.1.0 -> 1.1.0
* [new tag] 1.1.1 -> 1.1.1
* [new tag] 1.1.10 -> 1.1.10
* [new tag] 1.1.11 -> 1.1.11
* [new tag] 1.1.12 -> 1.1.12
* [new tag] 1.1.13 -> 1.1.13
* [new tag] 1.1.2 -> 1.1.2
* [new tag] 1.1.3 -> 1.1.3
* [new tag] 1.1.4 -> 1.1.4
* [new tag] 1.1.5 -> 1.1.5
* [new tag] 1.1.6 -> 1.1.6
* [new tag] 1.1.7 -> 1.1.7
* [new tag] 1.1.8 -> 1.1.8
* [new tag] 1.1.9 -> 1.1.9
* [new tag] 1.2.0 -> 1.2.0
* [new tag] 1.2.1 -> 1.2.1
* [new tag] 1.2.2 -> 1.2.2
* [new tag] 1.2.3 -> 1.2.3
* [new tag] 1.2.4 -> 1.2.4
* [new tag] 1.2.5 -> 1.2.5
* [new tag] 1.2.6 -> 1.2.6
* [new tag] 1.3.0 -> 1.3.0
* [new tag] 1.3.1 -> 1.3.1
* [new tag] 1.3.2 -> 1.3.2
* [new tag] 1.3.3 -> 1.3.3
* [new tag] 1.3.4 -> 1.3.4
* [new tag] 1.3.5 -> 1.3.5
* [new tag] 1.3.6 -> 1.3.6
* [new tag] 1.3.7 -> 1.3.7
* [new tag] 1.3.8 -> 1.3.8
HEAD is now at 9e93720 Merge pull request #3467 from ilovezfs/bump-formula-pr-hub-not-configured
==> Downloadinghttps://homebrew.bintray.com/bottles-portable/portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring portable-ruby-2.3.3.leopard_64.bottle.1.tar.gz
==>Tapping homebrew/core
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core'...
remote: Counting objects: 4637, done.
remote: Compressing objects: 100% (4417/4417), done.
remote: Total 4637 (delta 36), reused 320 (delta 10), pack-reused 0
Receiving objects: 100% (4637/4637), 3.83 MiB | 19.00 KiB/s, done.
Resolving deltas: 100% (36/36), done.
Checking connectivity... done.
Tapped 4412 formulae (4,683 files, 12.0MB)
==>Cleaning up /Library/Caches/Homebrew...
==>Migrating /Library/Caches/Homebrew to /Users/guoxiaoliang/Desktop/GXG/Library/Caches/Homebrew...
==>Deleting /Library/Caches/Homebrew...
Already up-to-date.
==>Installation successful!
==>Homebrew has enabled anonymous aggregate user behaviour analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics.html
==>Next steps:
- Run `brew help` to get started
- Further documentation:
Installing requirements for osx.
Updating system.........
Installing required packages: autoconf, automake, libtool, pkg-config, coreutils, libyaml, readline, libksba, openssl@1.1..........
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/guoxiaoliang/Desktop/GXG/.rvm/rubies/ruby-2.4.1, this may take a while depending on your cpu(s)...
ruby-2.4.1 - #downloading ruby-2.4.1, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.9M 100 11.9M 0 0 1272k 0 0:00:09 0:00:09 --:--:-- 862k
ruby-2.4.1 - #extracting ruby-2.4.1 to /Users/guoxiaoliang/Desktop/GXG/.rvm/src/ruby-2.4.1....
ruby-2.4.1 - #applying patch /Users/guoxiaoliang/Desktop/GXG/.rvm/patches/ruby/2.4.1/random_c_using_NR_prefix.patch.
ruby-2.4.1 - #configuring...................................................................
ruby-2.4.1 - #post-configuration.
ruby-2.4.1 - #compiling..............................................................
ruby-2.4.1 - #installing.......
ruby-2.4.1 - #making binaries executable..
ruby-2.4.1 - #downloading rubygems-2.6.14
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 751k 100 751k 0 0 29672 0 0:00:25 0:00:25 --:--:-- 31127
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.4.1 - #extracting rubygems-2.6.14....
ruby-2.4.1 - #removing old rubygems.........
$LANG was empty, setting up LANG=en_US, if it fails again try setting LANG to something sane and try again.
ruby-2.4.1 - #installing rubygems-2.6.14...........................
ruby-2.4.1 - #gemset created /Users/guoxiaoliang/Desktop/GXG/.rvm/gems/ruby-2.4.1@global
ruby-2.4.1 - #importing gemset /Users/guoxiaoliang/Desktop/GXG/.rvm/gemsets/global.gems....................|
ruby-2.4.1 - #generating global wrappers........
ruby-2.4.1 - #gemset created /Users/guoxiaoliang/Desktop/GXG/.rvm/gems/ruby-2.4.1
ruby-2.4.1 - #importing gemsetfile /Users/guoxiaoliang/Desktop/GXG/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.4.1 - #generating default wrappers........
ruby-2.4.1 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.4.1 - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
中间貌似和教程也不太一样,但是-v下
gxl:~ guoxiaoliang$ ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin14]
居然成功了,就不管了。
然后继续按照痛的领悟-v下gem
gxl:~ guoxiaoliang$ gem -v
2.6.14
发现没问题,管他什么版本呢,先install下试试
gxl:~ guoxiaoliang$ gem install jekyll
Fetching: public_suffix-3.0.1.gem (100%)
/Users/guoxiaoliang/Desktop/GXG/.rvm/gems/ruby-2.4.1@global/gems/gem-wrappers-1.3.2/lib/gem-wrappers/installer.rb:56: warning: Insecure world writable dir /Users/guoxiaoliang/Desktop/GXG in PATH, mode 040777
Successfully installed public_suffix-3.0.1
Fetching: addressable-2.5.2.gem (100%)
Successfully installed addressable-2.5.2
Fetching: colorator-1.1.0.gem (100%)
Successfully installed colorator-1.1.0
Fetching: rb-fsevent-0.10.2.gem (100%)
Successfully installed rb-fsevent-0.10.2
Fetching: ffi-1.9.18.gem (100%)
Building native extensions. This could take a while...
Successfully installed ffi-1.9.18
Fetching: rb-inotify-0.9.10.gem (100%)
Successfully installed rb-inotify-0.9.10
Fetching: sass-listen-4.0.0.gem (100%)
Successfully installed sass-listen-4.0.0
Fetching: sass-3.5.3.gem (100%)
Successfully installed sass-3.5.3
Fetching: jekyll-sass-converter-1.5.0.gem (100%)
Successfully installed jekyll-sass-converter-1.5.0
Fetching: listen-3.0.8.gem (100%)
Successfully installed listen-3.0.8
Fetching: jekyll-watch-1.5.0.gem (100%)
Successfully installed jekyll-watch-1.5.0
Fetching: kramdown-1.15.0.gem (100%)
Successfully installed kramdown-1.15.0
Fetching: liquid-4.0.0.gem (100%)
Successfully installed liquid-4.0.0
Fetching: mercenary-0.3.6.gem (100%)
Successfully installed mercenary-0.3.6
Fetching: forwardable-extended-2.6.0.gem (100%)
Successfully installed forwardable-extended-2.6.0
Fetching: pathutil-0.16.0.gem (100%)
Successfully installed pathutil-0.16.0
Fetching: rouge-2.2.1.gem (100%)
Successfully installed rouge-2.2.1
Fetching: safe_yaml-1.0.4.gem (100%)
Successfully installed safe_yaml-1.0.4
Fetching: jekyll-3.6.2.gem (100%)
Successfully installed jekyll-3.6.2
Parsing documentation for public_suffix-3.0.1
Installing ri documentation for public_suffix-3.0.1
Parsing documentation for addressable-2.5.2
Installing ri documentation for addressable-2.5.2
Parsing documentation for colorator-1.1.0
Installing ri documentation for colorator-1.1.0
Parsing documentation for rb-fsevent-0.10.2
Installing ri documentation for rb-fsevent-0.10.2
Parsing documentation for ffi-1.9.18
Installing ri documentation for ffi-1.9.18
Parsing documentation for rb-inotify-0.9.10
Installing ri documentation for rb-inotify-0.9.10
Parsing documentation for sass-listen-4.0.0
Installing ri documentation for sass-listen-4.0.0
Parsing documentation for sass-3.5.3
Installing ri documentation for sass-3.5.3
Parsing documentation for jekyll-sass-converter-1.5.0
Installing ri documentation for jekyll-sass-converter-1.5.0
Parsing documentation for listen-3.0.8
Installing ri documentation for listen-3.0.8
Parsing documentation for jekyll-watch-1.5.0
Installing ri documentation for jekyll-watch-1.5.0
Parsing documentation for kramdown-1.15.0
Installing ri documentation for kramdown-1.15.0
Parsing documentation for liquid-4.0.0
Installing ri documentation for liquid-4.0.0
Parsing documentation for mercenary-0.3.6
Installing ri documentation for mercenary-0.3.6
Parsing documentation for forwardable-extended-2.6.0
Installing ri documentation for forwardable-extended-2.6.0
Parsing documentation for pathutil-0.16.0
Installing ri documentation for pathutil-0.16.0
Parsing documentation for rouge-2.2.1
Installing ri documentation for rouge-2.2.1
Parsing documentation for safe_yaml-1.0.4
Installing ri documentation for safe_yaml-1.0.4
Parsing documentation for jekyll-3.6.2
Installing ri documentation for jekyll-3.6.2
Done installing documentation for public_suffix, addressable, colorator, rb-fsevent, ffi, rb-inotify, sass-listen, sass, jekyll-sass-converter, listen, jekyll-watch, kramdown, liquid, mercenary, forwardable-extended, pathutil, rouge, safe_yaml, jekyll after 27 seconds
19 gems installed
成功了,-v下(这个学到了就要用下)
gxl:~ guoxiaoliang$ jekyll -v
jekyll 3.6.2
好了,我的起死回生的经历希望对你有帮助
网友评论