Homeland 这个 ruby-china 安装是缺少某个插件吗?

kjpioo · 2012年01月08日 · 最后由 huacnlee 回复于 2012年02月04日 · 4831 次阅读

操作按照 ruby-china 源码包之 README.markdown 文件,进行到 cap deploy 的时候报错:

~/oss/ruby_china$  cap deploy
  * executing `deploy'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote git://github.com/huacnlee/ruby-china.git master"
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/capistrano-2.9.0/lib/capistrano/recipes/deploy.rb:106: warning: Insecure world writable dir /home/user in PATH, mode 040777
    command finished in 5051ms
  * executing "if [ -d /home/user/oss/ruby-china/shared/cached-copy ]; then cd /home/user/oss/ruby-china/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard a5551fxxxxxxxxxxxxxxxxxxxxxxxxxx52 && git clean -q -d -x -f; else git clone -q --depth 1 git://github.com/huacnlee/ruby-china.git /home/user/oss/ruby-china/shared/cached-copy && cd /home/user/oss/ruby-china/shared/cached-copy && git checkout -q -b deploy a5551fxxxxxxxxxxxxxxxxxxxxxxxxxx52; fi"
    servers: ["127.0.0.1"]
Password: 
    [127.0.0.1] executing command
    command finished in 16057ms
    copying the cached version to /home/user/oss/ruby-china/releases/20120108142231
  * executing "cp -RPp /home/user/oss/ruby-china/shared/cached-copy /home/user/oss/ruby-china/releases/20120108142231 && (echo a5551fxxxxxxxxxxxxxxxxxxxxxxxxxx52 > /home/user/oss/ruby-china/releases/20120108142231/REVISION)"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 44ms
  * executing `deploy:finalize_update'
  * executing "chmod -R g+w /home/user/oss/ruby-china/releases/20120108142231"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 15ms
  * executing "rm -rf /home/user/oss/ruby-china/releases/20120108142231/log /home/user/oss/ruby-china/releases/20120108142231/public/system /home/user/oss/ruby-china/releases/20120108142231/tmp/pids &&\\\n      mkdir -p /home/user/oss/ruby-china/releases/20120108142231/public &&\\\n      mkdir -p /home/user/oss/ruby-china/releases/20120108142231/tmp &&\\\n      ln -s /home/user/oss/ruby-china/shared/log /home/user/oss/ruby-china/releases/20120108142231/log &&\\\n      ln -s /home/user/oss/ruby-china/shared/system /home/user/oss/ruby-china/releases/20120108142231/public/system &&\\\n      ln -s /home/user/oss/ruby-china/shared/pids /home/user/oss/ruby-china/releases/20120108142231/tmp/pids"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 18ms
  * executing "find /home/user/oss/ruby-china/releases/20120108142231/public/images /home/user/oss/ruby-china/releases/20120108142231/public/stylesheets /home/user/oss/ruby-china/releases/20120108142231/public/javascripts -exec touch -t 201201081422.31 {} ';'; true"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
*** [err :: 127.0.0.1] find: `/home/user/oss/ruby-china/releases/20120108142231/public/images'
*** [err :: 127.0.0.1] : 没有那个文件或目录
*** [err :: 127.0.0.1] 
*** [err :: 127.0.0.1] find: `/home/user/oss/ruby-china/releases/20120108142231/public/stylesheets': 没有那个文件或目录
*** [err :: 127.0.0.1] find: `/home/user/oss/ruby-china/releases/20120108142231/public/javascripts': 没有那个文件或目录
    command finished in 11ms
    triggering after callbacks for `deploy:finalize_update'
  * executing `deploy:symlink'
  * executing "rm -f /home/user/oss/ruby-china/current && ln -s /home/user/oss/ruby-china/releases/20120108142231 /home/user/oss/ruby-china/current"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 10ms
  * executing `init_shared_path'
  * executing "mkdir -p /home/user/oss/ruby-china/shared/log"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 23ms
  * executing "mkdir -p /home/user/oss/ruby-china/shared/pids"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 10ms
  * executing "mkdir -p /home/user/oss/ruby-china/shared/assets"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 17ms
  * executing `link_shared_files'
  * executing "ln -sf /home/user/oss/ruby-china/shared/config/*.yml /home/user/oss/ruby-china/current/config/"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 9ms
  * executing "ln -sf /home/user/oss/ruby-china/shared/config/unicorn.rb /home/user/oss/ruby-china/current/config/"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 9ms
  * executing "ln -s /home/user/oss/ruby-china/shared/assets /home/user/oss/ruby-china/current/public/assets"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 12ms
  * executing `install_gems'
  * executing "cd /home/user/oss/ruby-china/current/; bundle install"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
*** [err :: 127.0.0.1] /home/user/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:209: warning: Insecure world writable dir /home/user in PATH, mode 040777
 ** [out :: 127.0.0.1] Using rake (0.9.2.2)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using multi_json (1.0.4)
 ** [out :: 127.0.0.1] Using activesupport (3.1.3)
 ** [out :: 127.0.0.1] Using builder (3.0.0)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using i18n (0.6.0)
 ** [out :: 127.0.0.1] Using activemodel (3.1.3)
 ** [out :: 127.0.0.1] Using erubis (2.7.0)
 ** [out :: 127.0.0.1] Using rack (1.3.6)
 ** [out :: 127.0.0.1] Using rack-cache (1.1)
 ** [out :: 127.0.0.1] Using rack-mount (0.8.3)
 ** [out :: 127.0.0.1] Using rack-test (0.6.1)
 ** [out :: 127.0.0.1] Using hike (1.2.1)
 ** [out :: 127.0.0.1] Using tilt (1.3.3)
 ** [out :: 127.0.0.1] Using sprockets (2.0.3)
 ** [out :: 127.0.0.1] Using actionpack (3.1.3)
 ** [out :: 127.0.0.1] Using mime-types (1.17.2)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using polyglot (0.3.3)
 ** [out :: 127.0.0.1] Using treetop (1.4.10)
 ** [out :: 127.0.0.1] Using mail (2.3.0)
 ** [out :: 127.0.0.1] Using actionmailer (3.1.3)
 ** [out :: 127.0.0.1] Using arel (2.2.1)
 ** [out :: 127.0.0.1] Using tzinfo (0.3.31)
 ** [out :: 127.0.0.1] Using activerecord (3.1.3)
 ** [out :: 127.0.0.1] Using activeresource (3.1.3)
 ** [out :: 127.0.0.1] Using addressable (2.2.6)
 ** [out :: 127.0.0.1] Using xml-simple (1.1.1)
 ** [out :: 127.0.0.1] Using aws-ses (0.4.4)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using bcrypt-ruby (3.0.1)
 ** [out :: 127.0.0.1] Using blankslate (2.1.2.4)
 ** [out :: 127.0.0.1] Using rack-ssl (1.3.2)
 ** [out :: 127.0.0.1] Using json (1.6.4)
 ** [out :: 127.0.0.1] Using rdoc (3.12)
 ** [out :: 127.0.0.1] Using thor (0.14.6)
 ** [out :: 127.0.0.1] Using railties (3.1.3)
 ** [out :: 127.0.0.1] Using bootstrap-rails (0.1.4) from git://github.com/xdite/bootstrap-rails.git (at master)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using will_paginate (3.0.2)
 ** [out :: 127.0.0.1] Using bootstrap-will_paginate (0.0.3)
 ** [out :: 127.0.0.1] Using bson (1.5.2)
 ** [out :: 127.0.0.1] Using bson_ext (1.5.2)
 ** [out :: 127.0.0.1] Using bundler (1.0.21)
 ** [out :: 127.0.0.1] Using cancan (1.6.7)
 ** [out :: 127.0.0.1] Using highline (1.6.8)
 ** [out :: 127.0.0.1] Using net-ssh (2.2.1)
 ** [out :: 127.0.0.1] Using net-scp (1.0.4)
 ** [out :: 127.0.0.1] Using net-sftp (2.0.5)
 ** [out :: 127.0.0.1] Using net-ssh-gateway (1.1.0)
 ** [out :: 127.0.0.1] Using capistrano (2.9.0)
 ** [out :: 127.0.0.1] Using carrierwave (0.5.6)
 ** [out :: 127.0.0.1] Using mongo (1.5.2)
 ** [out :: 127.0.0.1] Using mongoid (2.3.4)
 ** [out :: 127.0.0.1] Using carrierwave-mongoid (0.1.2)
 ** [out :: 127.0.0.1] Using cells (3.6.7)
 ** [out :: 127.0.0.1] Using chinese_pinyin (0.4.1)
 ** [out :: 127.0.0.1] Using chunky_png (1.2.5)
 ** [out :: 127.0.0.1] Using coffee-script-source (1.1.3)
 ** [out :: 127.0.0.1] Using execjs (1.2.9)
 ** [out :: 127.0.0.1] Using coffee-script (2.2.0)
 ** [out :: 127.0.0.1] Using coffee-rails (3.1.1)
 ** [out :: 127.0.0.1] Using daemon-spawn (0.4.2)
 ** [out :: 127.0.0.1] Using dalli (1.1.1)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using orm_adapter (0.0.5)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using warden (1.1.0)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using devise (1.5.2)
 ** [out :: 127.0.0.1] Using diff-lcs (1.1.3)
 ** [out :: 127.0.0.1] Using escape (0.0.4)
 ** [out :: 127.0.0.1] Using factory_girl (2.3.2)
 ** [out :: 127.0.0.1] Using factory_girl_rails (1.4.0)
 ** [out :: 127.0.0.1] Using multipart-post (1.1.4)
 ** [out :: 127.0.0.1] Using faraday (0.7.5)
 ** [out :: 127.0.0.1] Using ffi (1.0.11)
 ** [out :: 127.0.0.1] Using hashie (1.2.0)
 ** [out :: 127.0.0.1] Using hpricot (0.8.5)
 ** [out :: 127.0.0.1] Using jquery-rails (1.0.16)
 ** [out :: 127.0.0.1] Using kgio (2.6.0)
 ** [out :: 127.0.0.1] Using mail_view (1.0.1) from git://github.com/37signals/mail_view.git (at master)
 ** [out :: 127.0.0.1] Using memcache-client (1.8.5)
 ** [out :: 127.0.0.1] Using subexec (0.1.0)
 ** [out :: 127.0.0.1] Using mini_magick (3.3)
 ** [out :: 127.0.0.1] Using mongo-rails-instrumentation (0.2.4)
 ** [out :: 127.0.0.1] Using mongoid_auto_increment_id (0.3.1)
 ** [out :: 127.0.0.1] Using nokogiri (1.5.0)
 ** [out :: 127.0.0.1] Using oauth (0.4.5)
 ** [out :: 127.0.0.1] Using oauth2 (0.5.1)
 ** [out :: 127.0.0.1] Using omniauth (1.0.1)
 ** [out :: 127.0.0.1] Using omniauth-oauth (1.0.0)
 ** [out :: 127.0.0.1] Using omniauth-douban (1.0.0.rc2) from git://github.com/ballantyne/omniauth-douban.git (at master)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using omniauth-oauth2 (1.0.0)
 ** [out :: 127.0.0.1] Using omniauth-github (1.0.0)
 ** [out :: 127.0.0.1] Using ruby-openid (2.1.8)
 ** [out :: 127.0.0.1] Using rack-openid (1.3.1)
 ** [out :: 127.0.0.1] Using omniauth-openid (1.0.1)
 ** [out :: 127.0.0.1] Using omniauth-twitter (0.0.7)
 ** [out :: 127.0.0.1] Using pr_geohash (1.0.0)
 ** [out :: 127.0.0.1] Using rubypython (0.5.3)
 ** [out :: 127.0.0.1] Using pygments.rb (0.2.4)
 ** [out :: 127.0.0.1] Using rack-protection (1.1.4)
 ** [out :: 127.0.0.1] Using rails (3.1.3)
 ** [out :: 127.0.0.1] Using rails-i18n (0.1.8)
 ** [out :: 127.0.0.1] Using rails_autolink (1.0.4)
 ** [out :: 127.0.0.1] Using raindrops (0.8.0)
 ** [out :: 127.0.0.1] Using redcarpet (2.0.0)
 ** [out :: 127.0.0.1] Using redis (2.2.2)
 ** [out :: 127.0.0.1] Using redis-namespace (1.0.3)
 ** [out :: 127.0.0.1] Using redis-objects (0.5.2)
 ** [out :: 127.0.0.1] Using rmmseg-cpp-huacnlee (0.2.8)
 ** [out :: 127.0.0.1] Using redis-search (0.6.3)
 ** [out :: 127.0.0.1] Using sinatra (1.3.1)
 ** [out :: 127.0.0.1] Using vegas (0.1.8)
 ** [out :: 127.0.0.1] Using resque (1.19.0)
 ** [out :: 127.0.0.1] Using resque_mailer (2.0.2)
 ** [out :: 127.0.0.1] Using rsolr (1.0.6)
 ** [out :: 127.0.0.1] Using rspec-core (2.7.1)
 ** [out :: 127.0.0.1] Using rspec-expectations (2.7.0)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using rspec-mocks (2.7.0)
 ** [out :: 127.0.0.1] Using rspec (2.7.0)
 ** [out :: 127.0.0.1] Using rspec-rails (2.7.0)
 ** [out :: 127.0.0.1] Using sass (3.1.11)
 ** [out :: 127.0.0.1] Using sass-rails (3.1.5)
 ** [out :: 127.0.0.1] Using settingslogic (2.0.6)
 ** [out :: 127.0.0.1] Using simple_form (2.0.0.dev) from git://github.com/plataformatec/simple_form.git (at master)
 ** [out :: 127.0.0.1] 
 ** [out :: 127.0.0.1] Using social-share-button (0.0.3)
 ** [out :: 127.0.0.1] Using sprite-factory (1.4.1)
 ** [out :: 127.0.0.1] Using sunspot (1.3.0)
 ** [out :: 127.0.0.1] Using sunspot_rails (1.3.0)
 ** [out :: 127.0.0.1] Using sunspot_solr (1.3.0)
 ** [out :: 127.0.0.1] Using uglifier (1.1.0)
 ** [out :: 127.0.0.1] Using unicorn (4.1.1)
 ** [out :: 127.0.0.1] Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
    command finished in 1642ms
  * executing `compile_assets'
  * executing "cd /home/user/oss/ruby-china/current/; bundle exec rake assets:precompile"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
*** [err :: 127.0.0.1] /home/user/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:209: warning: Insecure world writable dir /home/user in PATH, mode 040777
*** [err :: 127.0.0.1] /home/user/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:209: warning: Insecure world writable dir /home/user in PATH, mode 040777
*** [err :: 127.0.0.1] :public is no longer used to avoid overloading Module#public, use :public_folder instead
*** [err :: 127.0.0.1] from /home/user/.rvm/gems/ruby-1.9.2-p290/gems/resque-1.19.0/lib/resque/server.rb:12:in `<class:Server>'
*** [err :: 127.0.0.1] /home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /home/user/.rvm/gems/ruby-1.9.2-p290/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
*** [err :: 127.0.0.1] /home/user/.rvm/gems/ruby-1.9.2-p290@global/gems/bundler-1.0.21/lib/bundler.rb:209: warning: Insecure world writable dir /home/user in PATH, mode 040777
*** [err :: 127.0.0.1] :public is no longer used to avoid overloading Module#public, use :public_folder instead
*** [err :: 127.0.0.1] from /home/user/.rvm/gems/ruby-1.9.2-p290/gems/resque-1.19.0/lib/resque/server.rb:12:in `<class:Server>'
*** [err :: 127.0.0.1] rake aborted!
*** [err :: 127.0.0.1] No such file or directory - /home/user/oss/ruby-china/releases/20120108142231/config/mongoid.yml
*** [err :: 127.0.0.1] 
*** [err :: 127.0.0.1] Tasks: TOP => environment
*** [err :: 127.0.0.1] (See full trace by running task with --trace)
*** [err :: 127.0.0.1] rake aborted!
*** [err :: 127.0.0.1] Command failed with status (1): [/home/user/.rvm/rubies/ruby-1.9.2-p290/bin/...]
*** [err :: 127.0.0.1] 
*** [err :: 127.0.0.1] Tasks: TOP => assets:precompile
*** [err :: 127.0.0.1] (See full trace by running task with --trace)
    command finished in 40509ms
*** [deploy:symlink] rolling back
  * executing "ls -x /home/user/oss/ruby-china/releases"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 11ms
  * executing "rm -f /home/user/oss/ruby-china/current; ln -s /home/user/oss/ruby-china/releases/20120108141008 /home/user/oss/ruby-china/current; true"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 12ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/user/oss/ruby-china/releases/20120108142231; true"
    servers: ["127.0.0.1"]
    [127.0.0.1] executing command
    command finished in 26ms
failed: "env PATH=/home/user/.rvm/gems/ruby-1.9.2-p290/bin:/home/user/.rvm/gems/ruby-1.9.2-p290@global/bin:/home/user/.rvm/rubies/ruby-1.9.2-p290/bin:/home/user/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games RUBY_VERSION=ruby-1.9.2-p290 GEM_HOME=/home/user/.rvm/gems/ruby-1.9.2-p290 GEM_PATH=/home/user/.rvm/gems/ruby-1.9.2-p290:/home/user/.rvm/gems/ruby-1.9.2-p290@global sh -c 'cd /home/user/oss/ruby-china/current/; bundle exec rake assets:precompile'" on 127.0.0.1

其中显示的“/home/user/oss/ruby-china/releases/20120108142231”这个目录是动态生成的。其中

[err :: 127.0.0.1] No such file or directory - /home/user/oss/ruby- china/releases/20120108142231/config/mongoid.yml

这个错误就很奇怪了:为什么没有生成 mongoid.yml

mongoid.yml 在 ruby-china/目录下:

~/oss/ruby_china$ mlocate mongoid.yml
/home/user/.rvm/gems/ruby-1.9.2-p290/gems/mongoid-2.3.4/lib/rails/generators/mongoid/config/templates/mongoid.yml
/home/user/oss/ruby_china/config/mongoid.yml
/home/user/oss/ruby_china/config/mongoid.yml.default

这两个 mongoid.yml 有什么关系?也就是怎么联系起来?

没加到 git 里?

#1 楼 @cqpx 意思是我要在 github 申请加入 github ruby-china 项目后?能解决上面的哪个问题? config.yml 里的 github_token 和 github_secret 值我都没有改过的。修改的有: domain 改成本地地址 : "127.0.0.1:3000" admin_emails: 改成本人 email upload_url: "http://127.0.0.1:3000/uploads"改成本地地址 该配置文件内其他未动

cd /home/user/oss/ruby_china/
git add config/mongoid.yml
git ci -am'add mongoid.yml'
cap deploy

https://github.com/huacnlee/ruby-china/blob/master/config/deploy.rb

task :link_shared_files

这一步从 #{deploy_to}/shared/ 目录链接了一些配置文件和 assets 目录到 current 目录,要在第一次跑的时候手工 cp 一份。详情我也不是很了解了,或许等 @huacnlee 说说

#4 楼 @Rei 第一次的时候要手工建立那列目录和文件

To 楼主,那个 delopy.rb 是在我们特定的环境特定的用户下面才能用的,你们部署就只是参考一下直接用当然不行

huacnlee 提问要有方法 提及了此话题。 04月03日 10:56
需要 登录 后方可回复, 如果你还没有账号请 注册新账号