天天看點

Ruby1.9.2RC On Rails3RC -- RVM

[size=x-large][b]Ruby1.9.2RC On Rails3RC -- RVM [/b][/size]

1. Install ruby 1.9.2RC and rails3RC -- In rvm

You should install the git or ruby && gem

1) Install rvm with Git

> bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
           

2) Install rvm with gem

>sudo gem install rvm

>rvm-install
           

3) Add this line to the end of .bashrc:

[ -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

> rvm install 1.9.2-head

> rvm 1.9.2-head
> ruby -v
           

5) Install rails3RC and dependences

> 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

> gem install rspec --prerelease
> gem install rspec-rails --prerelease
           

7)Install bundler 1.0.0RC.2

> gem install bundler --prerelease
           

Done

Hopefully everything worked:

> 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

rvm system
           

Back to your Rails3.0 environment

rvm 1.9.2-head
           

Use your RVM environment as your Default

rvm 1.9.2-head --default
           

2. Create a new app

> 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

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:

You should set config, let it autoload lib.

config/application.rb

config.autoload_paths += %W(#{config.root}/lib)
           

3. RESTful_authentication For Rails3

http://github.com/Satish/restful-authentication