1 - Installing RVM
$ sudo gem install rvm
$ (rvm-install已过时)
$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
Finally put this lines in your .bash_profile or .bashrc:
if [[ -s $HOME/.rvm/scripts/rvm ]] ; then
source $HOME/.rvm/scripts/rvm
fi
Restart your terminal, Rvm should be working by now.
2 - Installing ruby inside your rvm
$ rvm install 1.8.7
Will install ruby 1.8.7
$ rvm install ruby-head
Will install ruby 1.9.2 or newer.
3 - Setting up rvm to use your specific ruby version
$ rvm use 1.8.7
To use just this time.
$ rvm use 1.8.7 --default
To use always this version.
If you are using any other ruby replace the “1.8.7” for your version.
4 - Installing rails 2 and rails 3 RC inside different gemsets
firstly select a ruby version
$ rvm use 1.8.7
You can separate your rails versions inside gemsets:
Rails 2:
Create the gemset:
$ rvm gemset create rails2
Setting up rvm to use always this gemset:
$ rvm use 1.8.7@rails2 --default
Installing rails 2:
$gem install rails
#前面不能加sudo,否则就安装到系统默认的gemsets而未安装到rvm的gemsets
$rvm gem list
$gem list
Rails 3:
Create the gemset:
$ rvm gemset create rails3
Setting up rvm to use always this gemset:
$rvm use 1.8.7@rails3 --default
Installing rails 3:
$gem install rails --pre
5 - Switching between different rails versions
Switching back to your system Ruby
rvm system
Back to your Rails3.0 environment
rvm 1.9.2@rails3
Switching to rails 2:
$ rvm use 1.8.7@rails2
$ rails -v
Rails 2.3.5
Switching to rails 3:
$ rvm use 1.8.7@rails3
$ rails -v
Rails 3.0.0.rc
rvm install ree
ERROR: There has been an error while trying to run the ree installer. Halting theinstallation.
Installed ruby 1.9.2 via RVM and getting the following error?
no such file to load -- openssl
Try getting RVM to install the required openssl files. Unfortunately this means removing ruby and installing it again.
rvm pkg install openssl
rvm remove 1.9.2
rvm install 1.9.2 --with-openssl- dir =$HOME/.rvm /usr
But hey, it works.
rvm no such file to load readline
rvm package install readline
rvm remove 1.8.7-p330
rvm install 1.8.7-p330 --with-readline-dir=$rvm_path/usr
Problem
When you try to run the console rails c
in a new Rails 3.0.3 application, and when you use rvm, you get the following error:
no such file to load -- readline (LoadError)
Solution
It’s quite like likely that the readline libraries are missing from your installation. To find out which ones go to the directory that the error is indicating (ie):
$cd /.rvm/src/ruby-1.8.7-p352/ext/readline
$ruby extconf.rb
$make
$sudo make install
If you get something like:checking for readline/readline.h... no
checking for editline/readline.h... no
then you are probably missing the neccessary header files for readline.
1、so install them in your system:
sudo urpmi readline-dev
(ie in Mandriva)
In Debian you will need to install libreadline5-dev and
libncurses5-dev (apt-get install).
When the package is installed successfully run the following again:
ruby extconf.rb
make
sudo make install
You should now be able to go back to your project and run rails c
with no errors.
2、if apt-get error, you can install from src code
从网上下载安装包下来安装
http://ftp.cn.debian.org/debian/pool/main/r/readline5/libreadline5-dev_5.2-7_i386.deb
http://ftp.cn.debian.org/debian/pool/main/n/ncurses/libncurses5-dev_5.7+20100313-5_i386.deb
3、下载 ruby-1.8.7-p352的软件包
找到 ruby-1.8.7-p352/
ext/readline copy to /.rvm/src/ruby-1.8.7-p352/ext/readline
$ruby extconf.rb
$make
$sudo make install
4、安装ruby的版本和系统默认的ruby版本相同
rvm install 1.8.7-p72 --with-openssl-dir=$HOME/.rvm/usr
相关推荐
RVM 和 Ruby on Rails Dockerfile 这个库包含的Dockerfile 与为的发布给公众。基础 Docker 镜像安装安装 。 从公共下载: docker pull dmitryzuev/rvm-rails (或者,您可以从 Dockerfile 构建映像: docker docker ...
Windows7_Cygwin_Git_RVM_Ruby1.9.3_Rails3_MongoD B_Nginx_Unicorn_Rspec_Guard_Spork(2-Ruby on Rails3 安装配置
rvm nginx passenger rails配置服务器.docx
Windows7+Cygwin+Git+RVM+Ruby1.9.3+Rails3+MongoDB+N ginx+Unicorn+Rspec+Guard+Spork(1-Cygwin 安装配置)
chef-rails, 厨房设置一个可以与 Nginx 和 Rails 一起滚动的Ubuntu服务器 主厨 rails安装一个准备为 Ruby on Rails 栈准备的Ubuntu服务器:NginxPostgreSQLRedisMemcached带RVM的rubyPhusion乘客独立要求Ubuntu ...
RVM
在学习Ruby on Rails的过程中,不同教程使用的Ruby和Rails版本不一样,为了保持和教程中使用的版本一致,我们可以用RVM(Ruby Version Manager)来控制当前的Ruby/Rails版本,方便切换。 RVM的安装在这里不是重点,...
RVM的库函数,帮助快速实现RVM,与Sklearn一起用
主要包括:似然函数计算,后验概率计算,贝叶斯统计框架。 此为rvm第二版,包括了快速边缘似然算法。
相关向量机(RVM) 预测 MATLAB小程序
有机会再试一试Rails了,只是原来接触的是2,现在已然变成了4,似乎现在的安装比原来会快些。。 Rails 4 安装 针对于安装了RVM 代码如下:gem install rails没有的话应该这样: 代码如下:sudo gem install rails安装...
RVM通过其命令行应用编程接口降低了ruby开发的许多方面的复杂性。借助RVM,您可以在开发、配置项、...而且,RVM是为Ruby应用程序设计的,而不仅仅是为Rails设计的!任何的基于Ruby的应用程序将受益于您对RVM的使用。
词集API Wordset API是Rails /葡萄API后端的 。 Wordset 是一个协作的结构化词典。 要使其在本地运行,您还需要克隆和设置 Ember 前端 。先决条件我们使用最新版本的 Ruby,2.1.5。 我们建议使用 RVM 来管理 Ruby ...
在学习Ruby on Rails的过程中,不同教程使用的Ruby和Rails版本不一样,为了保持和教程中使用的版本一致,我们可以用RVM(Ruby Version Manager)来控制当前的Ruby/Rails版本,方便切换。
rvm线性回归_matlab_RVM回归_matlab
RVM 用于帮你安装Ruby环境,帮你管理多个Ruby环境,帮你管理你开发的每个Ruby应用使用机器上哪个Ruby环境。Ruby环境不仅仅是Ruby本身,还包括依赖的第三方Ruby插件。都由RVM管理。 Rails 这个也不用多说,著名开发...
tipping大师最经典的两篇文章,看懂之后笑傲RVM,纯英文,需要一定语言基础
相关向量机RVM用于预测和分类,含有归一化,训练和测试,可以多变量输出,解决海瑟矩阵问题
RVM很好的参考资料啊,看完这个基本上就可以对rvm有个大概的了解了,基本可以上手了哦。