sed -i.backup -e 's/ftp\.ruby-lang\.org\/pub\/ruby/ruby\.taobao\.org\/mirrors\/ruby/g' /usr/local/rvm/config/db
使用rvm安装ruby
123456789101112
rvm list known #查看源里面有那写软件rvm install 1.9.3 #安装1.9.3的rubyrvm use 1.9.3 --default #使用1.9.3的ruby#rvm 其他命令rvm list
#查看安装的rubiesrvm [-v][--version]#查看版本rvm remove <ruby_version>
#卸载一个版本
安装Octopress
12345678910111213141516171819202122
git clone git://github.com/imathis/octopress.git octopress
cd octopress
#如果使用的是RVM,这一步会被讯网你是否相信.rvmrc,选择yesgem install bundler
bundle install
#安装依赖rake install['Theme Name']#安装主题,无参数则是默认主题#如果要更换主题,先看完主题的文章后再更换octopress/_config.yml #octopress配置文件#可以在octopress/_config.yml修改博客设置,诸如博客标题,插件,以及url格式等#_config.yml基本配置vim /var/www/html/blog/octopress/_config.yml
url: http://leon8693.github.io #网站urltitle: 唯一的真理 #标签subtitle: True or False #副标题author: leon #作者simple_search: http://google.com/search #搜索引擎description: #网站的描述,出现在HTML页面中的 meta 中的 description
测试
rake preview #在本机4000端口生成访问内容
rake基本命令
123456789101112131415161718192021
rake -T
rake clean # Clean out caches: .pygments-cache, .gist-cache, .sass-cacherake copydot[source,dest]# copy dot files for deploymentrake deploy # Default deploy taskrake gen_deploy # Generate website and deployrake generate # Generate jekyll siterake install[theme]# Initial setup for Octopress: copies the default theme into the path of Jekyll's generator.rake integrate # Move all stashed posts back into the posts directory, ready for site generation.rake isolate[filename]# Move all other posts than the one currently being worked on to a temporary stash location (stash) so regener...rake list # list tasksrake new_page[filename]# Create a new page in source/(filename)/index.markdownrake new_post[title]# Begin a new post in source/_postsrake preview # preview the site in a web browserrake push # deploy public directory to github pagesrake rsync # Deploy website via rsyncrake set_root_dir[dir]# Update configurations to support publishing to root or sub directoryrake setup_github_pages # Set up _deploy folder and deploy branch for Github Pages deploymentrake update_source[theme]# Move source to source.old, install source theme updates, replace source/_includes/navigation.html with sourc...rake update_style[theme]# Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/customrake watch # Watch the site and regenerate when it changes