系统:ubuntu 11.10 ruby 版本:1.9.2 rails 版本:3.1.1 mongodb 版本:2.0.1 redis 版本:2.4.2
全部从全新系统开始,搞了两遍,依然没有解决,以下是我的安装步骤:
基本设置及常用软件安装
# 建立程序安装目录
$ cd ~
$ mkdir apps
# 建立工作目录
$ cd ~
$ mkdir workspace
# 安装常用库及软件
$ sudo apt-get install git git-core vim curl libxml2-dev libxslt-dev make gcc g++
Ruby on Rails 安装
1.Ruby install
$ sudo apt-get install ruby1.9.2-full
# 查看当前系统ruby版本
$ ruby -v
# ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
2.Gem update
$ sudo gem install rubygems-update
$ sudo update_rubygems
$ gem -v
# 1.8.11
# 将下面语句写入~/.gemrc 禁止Gem安装本地文档
gem: --no-ri --no-rdoc```
3.Rails install
```bash
$ sudo gem install rails
$ rails -v
# Rails 3.1.1
4.Other install
$ sudo apt-get install sqlite3 libsqlite3-dev
$ sudo gem install sqlite3-ruby
MongoDB 安装
1.install
$ cd ~/apps
$ wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.0.1.tgz
$ tar xzf mongodb-linux-i686-2.0.1.tgz
$ sudo ln -s ~/apps/mongodb-linux-i686-2.0.1/bin/mongod /usr/bin/mongod
$ sudo ln -s ~/apps/mongodb-linux-i686-2.0.1/bin/mongo /usr/bin/mongo
# create data directory
$ sudo mkdir -p /data/db
# set permission
$ sudo chmod 755 -R /data/db
bash
$ sudo mongod
# 如果数据库目录不想建立在/data/db,可以用--dbpath参数指定目录
3.test
$ mongo
> db.foo.save( { a : 1 } )
> db.foo.find()
Redis 安装
install
$ cd ~/apps
$ wget http://redis.googlecode.com/files/redis-2.4.2.tar.gz
$ tar xzf redis-2.4.2.tar.gz
$ cd redis-2.4.2
$ sudo make
$ sudo make install
run server
$ sudo src/redis-server
test
$ sudo src/redis-cli
redis> set foo bar
OK
redis> get foo
"bar"
安装 ruby-china 1.Node.js install
$ sudo apt-get install libssl-dev apache2-utils
$ cd ~/workspace
$ git clone git://github.com/ry/node.git
$ cd node
$ ./configure
$ make
$ sudo make install
bash
$ sudo gem install thin execjs therubyracer
$ sudo gem install nokogiri -v '1.5.0'
$ cd ~/workspace
$ git clone https://github.com/huacnlee/ruby-china.git
$ cd ruby-china
$ cp config/config.yml.default config/config.yml
$ cp config/mongoid.yml.default config/mongoid.yml
$ cp config/redis.yml.default config/redis.yml
$ sudo bundle install
$ sudo rake assets:precompile
$ thin start -O -C config/thin.yml
$ ./script/resque start
运行到最后第三部(sudo rake assets:precompile
)时,出现问题如下:
bindiry@bindiry-ubuntu:~/workspace/ruby-china$ sudo rake assets:precompile
rake aborted!
Failed to connect to a master node at 127.0.0.1:27017
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/usr/bin/ruby1.9.1 /usr/bin/rake assets:pr...]
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
bindiry@bindiry-ubuntu:~/workspace/ruby-china$ sudo rake assets:precompile
rake aborted!
uninitialized constant AWS
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [/usr/bin/ruby1.9.1 /usr/bin/rake assets:pr...]
之前已经发过帖子 http://ruby-china.org/topics/55 里面@huacnlee @cqpx @Rei 给出的介绍方法均尝试过,都没有解决,所以开个新帖,把我的操作步骤仔细说一下,哪位同学帮我解决一下?