最近又重新燃起对github pages的兴趣,github page的模板语言jekyll需要依赖ruby,因此需要在本机安装ruby环境。
准备
- 系统环境:win10
- ruby:rubyinstaller-devkit-3.0.3-1-x64.exe
官网
安装
点击exe进行安装,安装完成后询问是否安装“development toolchain”,选择“是”。
如果没有选择,也可以打开命令行输入命令ridk install
,在界面中选择安装。
至此,ruby和gem已经安装成功
ruby -v
gem -v
如果官方gem员无法使用,可以替换为国内源,位置是:msys64\etc\pacman.d
目录
mirrorlist.msys
##
## MSYS2 repository mirrorlist
##
## Primary
## msys2.org
Server = http://mirrors.ustc.edu.cn/msys2/msys/$arch/
Server = http://repo.msys2.org/msys/$arch
Server = http://downloads.sourceforge.net/project/msys2/REPOS/MSYS2/$arch
Server = http://www2.futureware.at/~nickoe/msys2-mirror/msys/$arch/
mirrorlist.mingw64
##
## 64-bit Mingw-w64 repository mirrorlist
##
## Primary
## msys2.org
Server = http://mirrors.ustc.edu.cn/msys2/mingw/x86_64/
Server = http://repo.msys2.org/mingw/x86_64
Server = http://downloads.sourceforge.net/project/msys2/REPOS/MINGW/x86_64
Server = http://www2.futureware.at/~nickoe/msys2-mirror/x86_64/
Server = http://mirror.bit.edu.cn/msys2/REPOS/
mirrorlist.mingw32
##
## 32-bit Mingw-w64 repository mirrorlist
##
## Primary
## msys2.org
Server = http://mirrors.ustc.edu.cn/msys2/mingw/i686/
Server = http://repo.msys2.org/mingw/i686
Server = http://downloads.sourceforge.net/project/msys2/REPOS/MINGW/i686
Server = http://www2.futureware.at/~nickoe/msys2-mirror/i686/
安装rails
gem install rails
rails -v
引用
【1】博客园-win10安装Ruby和Ruby on Rails-[2021-12-30]