安装ruby新版本(github上的rbenv文档--)
来源:互联网 发布:收银软件连锁 编辑:程序博客网 时间:2024/06/03 03:12
https://github.com/sstephenson/rbenv
- Check out rbenv into
~/.rbenv
.$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
- Add
~/.rbenv/bin
to your$PATH
for access to therbenv
command-line utility.$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
Ubuntu Desktop note: Modify your
~/.bashrc
instead of~/.bash_profile
.Zsh note: Modify your
~/.zshrc
file instead of~/.bash_profile
. - Add
rbenv init
to your shell to enable shims and autocompletion.$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
Same as in previous step, use
~/.bashrc
on Ubuntu, or~/.zshrc
for Zsh. - Restart your shell so that PATH changes take effect. (Opening a new terminal tab will usually do it.) Now check if rbenv was set up:
$ type rbenv#=> "rbenv is a function"
- (Optional) Install ruby-build, which provides the
rbenv install
command that simplifies the process ofinstalling new Ruby versions.
Upgrading
If you've installed rbenv manually using git, you can upgrade your installation to the cutting-edge version at any time.
$ cd ~/.rbenv$ git pull
To use a specific release of rbenv, check out the corresponding tag:
$ cd ~/.rbenv$ git fetch$ git checkout v0.3.0--------------------------------------------
$rbenv install --list 如果发现没有自己想要装的版本
$cd ~/.rbenv
$git pull
$cd plugins
$cd ruby-build
$git pull
$rbenv install --list
$rbenv install 2.1.2
==========如果这时候下载不了====
查看https://github.com/sstephenson/ruby-build#readme
Package download caching
You can instruct ruby-build to keep a local cache of downloaded package files by setting theRUBY_BUILD_CACHE_PATH
environment variable. When set, package files will be kept in this directory after the first successful download and reused by subsequent invocations of ruby-build
and rbenv install
.
The rbenv install
command defaults this path to ~/.rbenv/cache
, so in most cases you can enable download caching simply by creating that directory.
新建个cache文件夹,手动下载安装包
2001 cd ~/.rbenv/
2002 ll
2003 mkdir cache
2004 cd cha
2005 cd cache/
2006 wget http://ruby.taobao.org/mirrors/ruby/ruby-2.2.2.tar.gz
2007 cd
2008 rbenv install 2.2.2 -v
=====================
$ruby -v
$rbenv global 2.1.2
$rbenv versions
还有一种方式是
$export RBENV_VERSION=2.1.2
但是这种方式只在当前终端窗口有效
$gem install rails
这时候会发现速度超级慢,
$gem list
$gem source -l
来到网页看一下吧 ruby.taobao.org,接着按照网页提示操作
$gem sources --remove http://rubygems.org/
....
$gem install bundler -V
新装的ruby里是没有bundler,rails这些gem,需要先安装一下
$bundle -V
这样就会自动安装项目里所有需要安装的gem
- 安装ruby新版本(github上的rbenv文档--)
- Rbenv在Mac上安装Ruby
- 用 Rbenv 来管理 Ruby 的安装
- 安装ruby一定要注意的一步(ruby -v和 rbenv version结果不一致)
- 我的RUBY之路--安装Ubuntu 14.04分区/ rbenv、ruby、rails开发环境搭建
- 安装rbenv
- rbenv配置ruby on rails 编程环境(Linux系统)
- 关于新版本iOS(7.1)离线文档的安装
- github上cocos2dx的说明文档
- github上的文档结构学习
- Ruby系列文章之9 ---OS X 10.8.1 系统 用Homebrew + rbenv 安装和管理ruby
- 在lunix旧版本的JDK上安装新版本
- MacOS下rvm安装新版本ruby时报curl SSL证书错误的解决
- rbenv 管理多个版本Ruby
- 安装新版本的Apache服务器(四)
- 安装新版本的cmake
- centos 6.3 上安装ruby 的命令
- ruby在MAC上的安装环境
- android自定义状态栏!!1
- mysqldump命令大全
- SVN常使用问题
- Android上玩玩Hook:Cydia Substrate实战
- jquery插件中的(function(){})
- 安装ruby新版本(github上的rbenv文档--)
- sleep和wait区别
- Apriori挖掘频繁模式,关联规则(附代码实现 java+mysql)
- 每天一个Linux命令-12(lsof)
- adb devices offline的一种解决方法:更新adb版本
- ueditor_v1.4.3_utf8_jsp用于ssh框架时图片的上传
- txt转换成pdf转换器的操作
- mysqldump时报警,解决办法
- Android 自定义复选框