set up RVM with rails2 and rails3

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

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
资源包主要包含以下内容: ASP项目源码:每个资源包中都包含完整的ASP项目源码,这些源码采用了经典的ASP技术开发,结构清晰、注释详细,帮助用户轻松理解整个项目的逻辑和实现方式。通过这些源码,用户可以学习到ASP的基本语法、服务器端脚本编写方法、数据库操作、用户权限管理等关键技术。 数据库设计文件:为了方便用户更好地理解系统的后台逻辑,每个项目中都附带了完整的数据库设计文件。这些文件通常包括数据库结构图、数据表设计文档,以及示例数据SQL脚本。用户可以通过这些文件快速搭建项目所需的数据库环境,并了解各个数据表之间的关系和作用。 详细的开发文档:每个资源包都附有详细的开发文档,文档内容包括项目背景介绍、功能模块说明、系统流程图、用户界面设计以及关键代码解析等。这些文档为用户提供了深入的学习材料,使得即便是从零开始的开发者也能逐步掌握项目开发的全过程。 项目演示与使用指南:为帮助用户更好地理解和使用这些ASP项目,每个资源包中都包含项目的演示文件和使用指南。演示文件通常以视频或图文形式展示项目的主要功能和操作流程,使用指南则详细说明了如何配置开发环境、部署项目以及常见问题的解决方法。 毕业设计参考:对于正在准备毕业设计的学生来说,这些资源包是绝佳的参考材料。每个项目不仅功能完善、结构清晰,还符合常见的毕业设计要求和标准。通过这些项目,学生可以学习到如何从零开始构建一个完整的Web系统,并积累丰富的项目经验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值