Skip to content
fuzhijing edited this page May 15, 2012 · 36 revisions

安装说明

开发环境

请先安装好以下内容:

ubuntu 10.04
vim 7.2 (http://github.com/saberma/vimfiles)

安装依赖组件

sudo apt-get install build-essential bison openssl libreadline6 libreadline-dev curl git-core \
  zlib1g zlib1g-dev libssl-dev vim libxml2-dev autoconf
# css_sprite rmagick require
sudo apt-get install imagemagick libmagick9-dev

安装RVM及ruby1.9.3-rc1

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

#将以下内容添加到 ~/.bashrc 的底部,如果使用zsh,则添加到 ~/.zshrc

[[ -s “$HOME/.rvm/scripts/rvm” ]] && source “$HOME/.rvm/scripts/rvm” # This loads RVM into a shell session.
#export RUBY_HEAP_MIN_SLOTS=500000 #fileutils.rb:1691: [BUG] gc_sweep(): unknown data type
export RUBY_HEAP_SLOTS_INCREMENT=500000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=60000000
export RUBY_FREE_MIN=50000

rvm install 1.9.3-rc1
rvm 1.9.3-rc1 --default

安装Rails3及其他Gems

gem install bundler foreman --no-ri --no-rdoc

安装Postgres数据库

sudo apt-get install postgresql-server

安装Redis

sudo mkdir -p /opt/redis
sudo chown www-data:www-data /opt/redis
cp src/* /opt/redis/

还需要安装imagemagick

sudo apt-get install imagemagick

获取ShopQi源代码

cd ~/Documents
git clone git://github.com/saberma/shopqi.git
cd shopqi
#安装gems
bundle install

创建表结构

bundle exec rake db:migrate
rake db:seed # 加载基础数据 
bundle exec rake shopqi:bootstrap

启动应用服务

cp Procfile.example Procfile
foreman start
注意:要先启动memcached和Redis,默认端口启动即可

点击以下链接查看

ShopQi官网 @ http://lvh.me:4000
商店后台管理 @ http://shopqi.smackaho.st:4000/admin
商店后台管理(带测试数据) @ http://myshopqi.smackaho.st:4000/admin
商店(带测试数据) @ http://myshopqi.smackaho.st:4000