---
title: "Ruby1.9.2RC On Rails3RC -- RVM"
author: "myrev"
date: "2010-08-14T16:33:20Z"
tags: []
categories: ["编程语言"]
slug: "ruby1-9-2rc-on-rails3rc-rvm"
draft: false
lastmod: "2010-08-14T16:33:20Z"
id: 737387
url: "https://myrev.iteye.com/blog/737387"
---

**Ruby1.9.2RC On Rails3RC -- RVM **

1. Install ruby 1.9.2RC and rails3RC -- In rvm

You should install the git or ruby && gem

1) Install rvm with Git


```java
> bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
```



2) Install rvm with gem


```java
>sudo gem install rvm

>rvm-install
```



3) Add this line to the end of .bashrc:

```java
[[ -s "$home/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
```


The above will make the environment correct for all new terminal windows. In order to make the environment correct for the current terminal, execute this:
source "$HOME/.rvm/scripts/rvm"

4) Install ruby 1.9.2RC


```java
> rvm install 1.9.2-head

> rvm 1.9.2-head
> ruby -v
```



5) Install rails3RC and dependences


```java
> gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n

> gem install rails --pre

> gem install sqlite3-ruby
```



6) Install rspec 2.0.0beta


```java
> gem install rspec --prerelease
> gem install rspec-rails --prerelease
```



7)Install bundler 1.0.0RC.2


```java
> gem install bundler --prerelease
```



Done

Hopefully everything worked:

```java

> ruby -v

  ruby 1.9.2rc

> rails --version

  Rails 3.0.0.RC

> gem list

  *** LOCAL GEMS ***

  abstract (1.0.0)
  actionmailer (3.0.0.beta)
  actionpack (3.0.0.beta)
  activemodel (3.0.0.beta)
  activerecord (3.0.0.beta)
  activeresource (3.0.0.beta)
  activesupport (3.0.0.beta, 2.3.5)
  arel (0.2.1)
  builder (2.1.2)
  bundler (0.9.7)
  erubis (2.6.5)
  i18n (0.3.3)
  mail (2.1.3)
  memcache-client (1.7.8)
  mime-types (1.16)
  mysql (2.8.1)
  rack (1.1.0)
  rack-mount (0.6.0, 0.4.7)
  rack-test (0.5.3)
  rails (3.0.0.beta)
  railties (3.0.0.beta)
  rake (0.8.7)
  sqlite3-ruby (1.2.5)
  text-format (1.0.0)
  text-hyphen (1.0.0)
  thor (0.13.3)
  tzinfo (0.3.16)
```


Switching back to your system Ruby


```java
rvm system
```


Back to your Rails3.0 environment


```java
rvm 1.9.2-head
```


Use your RVM environment as your Default


```java
rvm 1.9.2-head --default
```



2. Create a new app


```java
> rails new AC_rails3 -d mysql

> cd AC_rails3

> bundle install

> rails server
```



3. Rspec

 To configure your app to use rspec-rails, add a declaration to your Gemfile.
  If you are using Bundler's grouping feature in your Gemfile, be sure to include
  rspec-rails in the :development group as well as the :test group so that you
  can access its generators and rake tasks.

#{RAILS_PATH}/Gemfile
Add

    
```java
group :development, :test do
      gem "rspec-rails", ">= 2.0.0.beta.19"
    end
```


  Be sure to run the following command in each of your Rails apps if you're
  upgrading:

  
```java
 > script/rails generate rspec:install

```


You should set config, let it autoload lib.

config/application.rb


```java
config.autoload_paths += %W(#{config.root}/lib)
```




3. RESTful_authentication For Rails3

http://github.com/Satish/restful-authentication