1. 安装debian
2. 安装ssh
3. ssh中文问题
4. 安装ruby 最新的1.9.2要自己安装
5. gem问题 zlib
6. 安装rails
7. 安装LAMP
1) sudo apt-get install php5
2) sudo apt-get install mysql-server mysql-client
3) sudo apt-get install php5-mysql php5-curl php5-gd
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