debian+ruby1.9.2+rails3.0.3+spork+rspec+cucumber

1. 安裝debianphp

2. 安裝sshjava

3. ssh中文問題 mysql

4. 安裝ruby 最新的1.9.2要本身安裝git

5. gem問題 zlibweb

6. 安裝railssql

7. 安裝LAMP數據庫

1) sudo apt-get install php5apache

2) sudo apt-get install mysql-server mysql-clientbootstrap

3) sudo apt-get  install  php5-mysql  php5-curl  php5-gdruby

4) dpkg  -l  'php5-*'

    5) sudo apt-get  install  libapache2-mod-php5  php5-mysql

    6) /etc/apache2/httdpd.conf 添加:

      AddType  application/x-httpd-php  .php

      AddType  application/x-httpd-php-source  .phps

    7) ln  -s  /etc/apache2/mods-available/php5.*  /etc/apache2//mods-enabled

    8) sudo apt-get  install  apache2-mpm-prefork

9) sudo apt-get install  mcrypt php5-mcrypt

10) sudo /etc/init.d/apache2  restart

8 mysql 遠程聯連的問題:

  1) 2003 Can’t connect to MySQL server on ‘192.168.10.18′ (10061)

  /etc/mysql/my.cnf

  # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. 

  bind-address = 127.0.0.1

  改爲bind-address = 0.0.0.0

  2)# mysql -u root -proot 

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

  再聯接就能夠了

 

9 安裝git sudo apt-get install git

10 . gem install rdoc 

sudo apt-get install libmysqlclient-dev

gem install mysql

gem install mysql2

若是有問題:http://hotsunshine.javaeye.com/blog/766724

11 . 驗證:

1. rails new mysqltest -d mysql 

2. 修改config/database.yml,注意password要用"123456"而不是123456

3. ruby script\rails generate model post title:string body:string

4. rake db:create:all 驗證:在數據庫中能看到相應的三個數據庫

5. rake db:migrate 成功

12. 安裝rspec、rspec-rails/spork/cucumber

gem install rspec rspec-rails cucumber cucumber-rails webrat

gem install rake  rm /usr/local/ruby/lib/ruby/gems/1.9.1/specifications/rake.gemspec (這是一個bug,要刪除這個文件rake才能用)

sudo apt-get install libxml2 libxml2-dev

sudo apt-get install libxslt-dev

gem install libxml-ruby

gem install spork

13. bundle 在rails中:

    Gemfile

    group :development ,:test do

 gem "webrat"

 gem "rspec-rails"

 gem "cucumber-rails"

 gem "spork"

end

bundle install

要求Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

14. script/rails generate rspec:install

script/rails generate cucumber:install

spork --bootstrap  

require 'rubygems'

require 'spork'

Spork.prefork do

end

Spork.each_run do

end

加到features/support/env.rb前面前

spork cucumber

spork rspec

15. rspec --drb spec

cucumber --drb feature

(沒有使用drb)

rake rspec

rake cucumber

相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息