rvm install 2.3.1
失败
.
cd octopress
.
ruby --version
.
rvm use 2.7.0
Required ruby-2.7.0 is not installed.
To install do: 'rvm install "ruby-2.7.0"'
.
dong@Ubuntu:~/octopress$ rvm install "ruby-2.7.0"
.
dong@Ubuntu:~/octopress$ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
.
dong@Ubuntu:~/octopress$ rake generate
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.
.
dong@Ubuntu:~/octopress$ bundle install
Traceback (most recent call last):
4: from /home/dong/.rvm/rubies/ruby-2.7.0/bin/ruby_executable_hooks:22:in `<main>'
3: from /home/dong/.rvm/rubies/ruby-2.7.0/bin/ruby_executable_hooks:22:in `eval'
2: from /home/dong/.rvm/rubies/ruby-2.7.0/bin/bundle:23:in `<main>'
1: from /home/dong/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/home/dong/.rvm/rubies/ruby-2.7.0/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.3) required by your /home/dong/octopress/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
.
dong@Ubuntu:~/octopress$ gem install bundler:1.17.3
Fetching bundler-1.17.3.gem
Successfully installed bundler-1.17.3
Parsing documentation for bundler-1.17.3
Installing ri documentation for bundler-1.17.3
Done installing documentation for bundler after 3 seconds
1 gem installed
.
dong@Ubuntu:~/octopress$ rake generate
Could not find rake-10.5.0 in any of the sources
Run `bundle install` to install missing gems.
.
dong@Ubuntu:~/octopress$ bundle install
.
dong@Ubuntu:~/octopress$ rake generate
rake aborted!
Gem::LoadError: You have already activated rake 13.0.1, but your Gemfile requires rake 10.5.0. Prepending `bundle exec` to your command may solve this.
/home/dong/octopress/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)
提示失败,
但是可以加上bundle exec
dong@Ubuntu:~/octopress$bundle exec rake generate
很多警告,但是成了,
下面也一样:
bundle exec rake preview
首先利用rfkill
命令查看目前无线传输设备的状态,rfkill
是一个命令行工具,可使用它查询和更改系统中启用了RFKill的设备。
rfkill的常用方法为:
rfkill list all
# 获得设备列表
rfkill block [index|type]
# 通过索引或类型禁用设备
rfkill unblock [index|type]
# 通过索引或类型启用设备
当前设备状态如下:
rfkill list all
输出:
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: yes
1: acer-wireless: Wireless LAN
Soft blocked: no
Hard blocked: no
通过rfkill启用/禁用设备无法对硬件阻塞产生作用。
由于笔记本只有一个无线网卡,这两个模块应该是有冲突
使用命令lsmod | grep acer可以看出系统启动了acer_wmi模块 |
通过查找资料后,解决方法为禁用acer_wmi模块。
ubuntu20.04安装了几次2.0都失败
ubuntu12.04已经无法安装系统本身的更新了,更别说安装其他软件
强迫症发作,于是有了这次:
git --version
sudo apt install git
git --version
github用户名
git config --global user.name "qiuhaidong"
#or haydnyau
github登录帐号邮箱名
git config --global user.email "690982322@qq.com"
#or 1148891016@qq.com
Password caching
To use this option, you need to turn on the credential helper so that git will save your password in memory for some time:
git config --global credential.helper cache
First, we need to check for existing ssh keys on your computer. Open up Terminal and run:
cd ~/.ssh
# Checks to see if there is a directory named ".ssh" in your user directory
If it says “No such file or directory” go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3.
最好就是把 .shh 这个文件夹删除了,做step 2
To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.不要输入文件名
ssh-keygen -t rsa -C "your_email@example.com"
我的就是:ssh-keygen -t rsa -C "690982322@qq.com"
#or 1148891016@qq.com
Now you need to enter a passphrase.设置密码。(有人是密码都不要的,再按两下enter就行了)
Which should give you something like this:
Your identification has been saved in /home/you/.ssh/id_rsa.
Your public key has been saved in /home/you/.ssh/id_rsa.pub.
The key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com
ctrl+h,显示隐藏文件,这里其实可以打开这个id_rsa.pub文件,直接复制,不用安装下面的软件
sudo apt-get install xclip
# Downloads and installs xclip.
xclip -sel clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard
到github网站,登陆,头像,设置,SSH and GPG keys,把旧的SSH keys删除,添加新的,title不用管,粘贴到key就行了
ssh -T git@github.com
这里可能会还要按照提示做一下,不难,看英文做
如果看到:
Hi qiuhaidong! You've successfully authenticated, but GitHub does not provide shell access.
# or haydnyau
If that username is correct, you’ve successfully set up your SSH key. Don’t worry about the shell access thing, you don’t want that anyway.
If you see “access denied” please consider using HTTPS instead of SSH. If you need SSH start at these instructions for diagnosing the issue.
看官网命令
rvm --version
gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
会显示失败,先不管它
Install RVM:命令
curl -sSL https://get.rvm.io | bash -s stable
如下:
dong@Ubuntu:~$ curl -sSL https://get.rvm.io | bash -s stable
Downloading https://github.com/rvm/rvm/archive/1.29.12.tar.gz
Downloading https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc
gpg: 于 2021年01月16日 星期六 02时46分22秒 CST 创建的签名,使用 RSA,钥匙号 39499BDB
gpg: 无法检查签名:没有公钥
GPG signature verification failed for '/home/dong/.rvm/archives/rvm-1.29.12.tgz' - 'https://github.com/rvm/rvm/releases/download/1.29.12/1.29.12.tar.gz.asc'! Try to install GPG v2 and then fetch the public key:
gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or if it fails:
command curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
command curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
In case of further problems with validation please refer to https://rvm.io/rvm/security
这个提示错误,并且给出了解决方法:
运行:
命令1:
curl -sSL https://rvm.io/mpapis.asc | gpg2 --import -
命令2:
curl -sSL https://rvm.io/pkuczynski.asc | gpg2 --import -
再运行上一条命令安装rvm:
curl -L https://get.rvm.io | bash -s stable
输出:
* To start using RVM you need to run `source /home/dong/.rvm/scripts/rvm`
安装成功,按照提示运行:
source /home/dong/.rvm/scripts/rvm
测试:
rvm --version
git --version
安装ruby2.2.6(1.9.3太久了,无法安装)
rvm install 2.2.6
会提示输入本机密码
rvm use 2.2.6
git clone -b source git@github.com:qiuhaidong/qiuhaidong.github.com.git octopress
# 或者 git clone git://github.com/imathis/octopress.git octopress
# octopress 2.0 原码
cd octopress
gem install bundler
bundle install
rake install
rake setup_github_pages
这里可能会要输入链接等,ssh,https
The rake task will ask you for a URL of the Github repo. Copy the SSH or HTTPS URL from your newly created repository
(e.g. git@github.com:username/username.github.io.git)
git@github.com:qiuhaidong/qiuhaidong.github.com.git
https://github.com/qiuhaidong/qiuhaidong.github.com.git
or
git@github.com:haydnyau/haydnyau.github.io.git
https://github.com/haydnyau/haydnyau.github.io.git
and paste it in as a response.
This will:
Next run:
rake generate
rake deploy
This will generate your blog, copy the generated files into _deploy/
, add them to git, commit and push them up to the master branch. In a few seconds you should get an email from Github telling you that your commit has been received and will be published on your site.
来自官网
下面这个不知道要不要做:
Now you have a place to commit the generated content for your site, but you should also set up repository to store the source for your blog. After you set up a repository for your blog source, add it as the origin remote.
git remote add origin (your repo url)
# set your new origin as the default branch
git config branch.master.remote origin
Now push your changes and you’ll be all set.
上面这个不知道要不要做:
来自官网
Don’t forget to commit the source for your blog.
git add .
git commit -m 'update'
git push origin source
category_list
插件在 octopress\plugins\
文件夹里面,新建一个文件,名为:category_list_tag.rb
。并将下面的代码粘贴到里面。
module Jekyll
class CategoryListTag < Liquid::Tag
def render(context)
html = ""
categories = context.registers[:site].categories.keys
categories.sort.each do |category|
posts_in_category = context.registers[:site].categories[category].size
category_dir = context.registers[:site].config['category_dir']
category_url = File.join(category_dir, category.gsub(/_|\P{Word}/, '-').gsub(/-{2,}/, '-').downcase)
html << "<li class='category'><a href='/#{category_url}/'>#{category} (#{posts_in_category})</a></li>\n"
end
html
end
end
end
Liquid::Template.register_tag('category_list', Jekyll::CategoryListTag)
这个插件会向liquid
注册一个名为category_list
的tag
,该tag
就是以li
的形式将站点所有的category
组织起来。如果要将category
加入到侧边导航栏,需要增加一个aside
。
aside
在 octopress\source\_includes\asides\
文件夹里面,新建一个文件,名为:category_list.html
。并粘贴下面的代码:
注意: 去掉 %
前面的2个 \
这里如果不加上\
,markdown格式会显示category_list
的内容。我是为了正确显示代码才加上的
<section>
<h1>Categories</h1>
<ul id="categories">
{\% category_list \%}
</ul>
</section>
代码如下:
dong@Ubuntu:~/octopress$ git push origin source
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
打开文件~/octopress/.git/config,查看
[remote "origin"]
url = git@github.com:haydnyau/haydnyau.github.io.git
我是改了几次,com.git和io.git搞错了
preview.sh代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build #生成
jekyll serve
=================================
deploy.sh代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build
octopress deploy
=================================
(不行,这个会造成有些blog页面头尾显示不全)发布,并上传/_posts/源文件,deploy.sh 代码
#!/bin/sh
cd /home/dong/haydnyau
jekyll build
mv _posts/ _site/
octopress deploy
mv _site/_posts/ .
注意这个点 “.”
.
或者 ./
表示当前目录
更改了/home/dong/haydnyau/_templates/post
增加了:
categories:
categories: {{ categories }}
因为格式问题没有显示,参见原文件
重装octopress 2.0 博客失败
很多新旧的软件,依赖,都不兼容了
算了,世界在发展,有的旧事物必然被淘汰
毕竟连作者都不维护了
而且连3.0都不维护了
============================
博文1,Octopress 3 Arrives to Make Blog Generation Crazy Simple
安装git
设置好用户名,email等等,参见之前的blog
添加ssh钥匙到github
安装rvm
安装ruby 2.7.0,好像默认就是
修复安装2.2.6失败的教程
安装octopress
gem install octopress
创建博客的主文件夹
octopress new haydnyau #名字自取
新建一篇blog
octopress new post hello world
生成网页
jekyll build
为避免下面的错误:
sudo bundle add webrick
本地预览
jekyll serve
dong@Ubuntu:~/haydnyau$ bundle exec jekyll serve
Configuration file: /home/dong/haydnyau/_config.yml
Source: /home/dong/haydnyau
Destination: /home/dong/haydnyau/_site
Incremental build: disabled. Enable with --incremental
Generating...
Jekyll Feed: Generating feed for posts
done in 0.398 seconds.
Auto-regeneration: enabled for '/home/dong/haydnyau'
------------------------------------------------
Jekyll 4.2.1 Please append `--trace` to the `serve` command
for any additional information or backtrace.
------------------------------------------------
/home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:179:in `require_relative'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:179:in `setup'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:100:in `process'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `each'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
from /home/dong/.rvm/gems/ruby-3.1.0/gems/jekyll-4.2.1/exe/jekyll:15:in `<top (required)>'
from /home/dong/.rvm/gems/ruby-3.1.0/bin/jekyll:25:in `load'
from /home/dong/.rvm/gems/ruby-3.1.0/bin/jekyll:25:in `<main>'
from /home/dong/.rvm/gems/ruby-3.1.0/bin/ruby_executable_hooks:22:in `eval'
from /home/dong/.rvm/gems/ruby-3.1.0/bin/ruby_executable_hooks:22:in `<main>'
dong@Ubuntu:~/haydnyau$
原因:
This happens because webrick is no longer a bundled gem in Ruby 3.0. From https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/:
- The following libraries are no longer bundled gems or standard libraries. Install the corresponding gems to use these features.
- sdbm
- webrick
- net-telnet
- xmlrpc
Adding gem "webrick"
to my Gemfile solves the problem, but Jekyll should include it in its gemspec.
I think you want run: bundle add webrick
.
我运行:
sudo bundle add webrick
dong@Ubuntu:~/haydnyau$ bundle add webrick
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Using public_suffix 4.0.6
Using bundler 2.3.4
Using colorator 1.1.0
Using concurrent-ruby 1.1.9
Using eventmachine 1.2.7
Using http_parser.rb 0.8.0
Using ffi 1.15.4
Using forwardable-extended 2.6.0
Using rb-fsevent 0.11.0
Using rexml 3.2.5
Using liquid 4.0.3
Using mercenary 0.4.0
Using rouge 3.27.0
Using safe_yaml 1.0.5
Using unicode-display_width 1.8.0
Using webrick 1.7.0
Using addressable 2.8.0
Using sassc 2.4.0
Using rb-inotify 0.10.1
Using kramdown 2.3.1
Using terminal-table 2.0.0
Using listen 3.7.0
Using kramdown-parser-gfm 1.1.0
Using jekyll-sass-converter 2.1.0
Using pathutil 0.16.2
Using em-websocket 0.5.3
Using i18n 1.8.11
Using jekyll-watch 2.2.1
Using jekyll 4.2.1
Using jekyll-feed 0.16.0
Using jekyll-seo-tag 2.7.1
Using minima 2.5.1
dong@Ubuntu:~/haydnyau$
问题解决
解决前后的Gemfile文件:
生成发布配置文件
octopress deploy init git git@github.com:haydnyau/haydnyau.github.com.git
发布
octopress deploy
git上传
git init
git add .
还有的以后琢磨
买个早餐,吃饱,睡觉
今晚
并不是说命中率最高、速度最快,而是心态最好,进入境界。
就像麦迪说的,35秒13分并不是他的最好,他的最好是进入了“in the zone”的境界。
我今晚也一样。
具体这样说吧:
心跳如常,不为任何情况所动,该怎样怎样。
进攻:
该跑跑,该停停,该切切,该快快,该慢慢。
该投投,不犹豫。
该晃晃,该突突,该传传,该断断。
防守:
该紧紧,该松松。
被背打就被背打,不懊恼。
能帽帽,不喜不惧。
其他:
投不进就不进,不懊恼,不可惜,继续。
失误就失误,继续。
开场还是抢七,该怎样怎样。
不怕强劲的对手,不怕拖累队友。
心态控制体能,微汗。
如李小龙说的:从心所欲,一心一意,表达自己。
心态如常,张弛有道,不为所动。
这一年,三件事:到京东打工,学做饭,耳朵生病。
打工
是做苦力,卖力气,很丢人,但,荒废了两年,终于动了。具体的,以前写过,不重复。
做饭
很有门道,比如炒青菜,刚下锅,有的马上熟了,有的还没炒到,心慌。淡定,正常翻炒,就行了。还有先炒猪肉,再放面去炒,再放青菜,看起来一大锅,怕青菜在上面炒不熟,慌了。淡定,正常翻炒,就行了。
淡定,正常地做,就行了。
生病
对自己太狠。秋冬,连续俩月通宵夜班,噪声大,有压力,情绪不稳定,早上洗冷水澡,重糖,重淀粉(米面主食),重油,重盐,吃辣椒,估计血糖高,血脂高,血压高,血粘稠,睡眠严重不足,內耳供血不足,听觉神经长期疲累不堪。免疫力下降,感冒,鼻塞,咽鼓管之类的不通畅。
种种原因,祸不单行,差点聋了。
就这三件事。
吸取教训,放下执念,放过自己,好好生活。