Ruby1.9.2 On Rails3.0.0_Ruby_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > Ruby > Ruby1.9.2 On Rails3.0.0

Ruby1.9.2 On Rails3.0.0

 2010/9/19 23:12:44  myrev  http://myrev.javaeye.com  我要评论(0)
  • 摘要:Ruby1.9.2OnRails3.0.0Required:sudoaptitudeinstallbisonsudoaptitudeinstalllibmysqlclient-devsudoaptitudeinstalllibxml2-devlibxslt-dev1.Installruby1.9.2andrails3--InrvmYoushouldinstallthegitorruby&&gem1)InstallrvmwithGit>bash<<
  • 标签:Ruby Rails3.0.0

Ruby1.9.2 On Rails3.0.0



Required:
sudo aptitude install bison
sudo aptitude install libmysqlclient-dev
sudo aptitude install libxml2-dev libxslt-dev


1. Install ruby 1.9.2 and rails3 -- 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.2

> rvm install 1.9.2
> rvm 1.9.2
> ruby -v


5) Install rails3 and dependences


> gem install tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n
> gem install rails


6) Install rspec 2.0.0beta

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


Done

Hopefully everything worked:


> ruby -v

? ruby 1.9.2p0

> rails --version

? Rails 3.0.0


Switching back to your system Ruby


>rvm system

Back to your Rails3.0 environment


>rvm 1.9.2

Use your RVM environment as your Default

>rvm 1.9.2 --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"
????? gem "webrat"
??? end


? Be sure to run the following command in each of your Rails apps if you're
? upgrading:

?? > script/rails generate rspec:install


You should set config, let it autoload lib.

config/application.rb

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



4. RESTful_authentication For Rails3

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

?

发表评论
用户名: 匿名