ruby-china本地部署流程

  1. 安装需要的库文件
    Install and start Redis, MongoDB, memcached, Python,Pygments
    redis       http://blog.csdn.net/hexudong08/article/details/7561904
    mongodb      http://blog.csdn.net/hexudong08/article/details/7696397 
    memcached   apt-get install memcached
    pygments       http://blog.csdn.net/hexudong08/article/details/7709083  

  2. 其他
    cp config/config.yml.default config/config.yml
    cp config/mongoid.yml.default config/mongoid.yml
    cp config/redis.yml.default config/redis.yml
    cp config/thin.yml.default config/thin.yml
    bundle install
    bundle exec rake db:migrate
    bundle exec rake db:seed
    bundle exec sidekiq -C config/sidekiq.yml
    bundle exec rake sunspot:solr:start
    rails s

  3. 给代码打tag, 源码阅读必备
     ctags -R --exclude=*.js --exclude=.git --exclude=*.log  --exclude=*.py --exclude=*.sml --exclude=*.xml . ~/.rvm/gems/ruby-1.9.3-p194/gems/

  4. 增加 pry gem
      gem 'pry'
      gem 'pry-rails'
      gem 'pry-doc'
      gem 'pry-nav'
      gem 'pry-remote'
      gem 'foreman'
    

  5. 新建Procfile文件,启动命令
    redis: redis-server
    mongodb: sudo service mongodb start
    siderkiq: bundle exec sidekiq -c config/sidekiq.yml
    solr: bundle exec rake sunspot:solr:start  
    rails: rails s
    

    =========================
  6. 补充
    抛如下异常:
    !! Rack application returned nil body. Probably you wanted it to be an empty string?
    !! Unexpected error while processing request: undefined method `each' for nil:NilClass

    是因为没有启动 memcached
    需要启动memcached, start cmd: memcached

    sidekiq 的启动需要 大写-C




你可能感兴趣的:(redis,mongodb,python,memcached,Solr,Rails)