Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@yangkit
VIP
NO. 901 / 2012-02-03

北京
0 Topics / 39 Replies
0 Followers
0 Following
4 Favorites
GitHub Public Repos
  • RubyConf-WorkShop 1

    Repository for workshop of Ruby China Conference 2014

  • zhengquan.github.com 1

    zhengquan.github.com

  • spring-mvc-docker-demo 0

  • Zhengquan 0

    Config files for my GitHub profile.

  • lvim-config 0

    Personal Lvim Config

  • text-generation-webui 0

    A gradio web UI for running Large Language Models like LLaMA, llama.cpp, GPT-J, Pythia, OPT, and ...

  • serverless-demo 0

    demo for serverless

  • tencent-examples 0

    Serverless Components Examples for Tencent Cloud.

  • network_list 0

    The one and only one here

  • transode-app-tempalte 0

    Transcode Demo

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Windows 生存手册 for Rubyists at August 03, 2013

    楼主文风和头像一致:恶意卖萌

  • 你看过的电影推荐 at July 21, 2013

    最近看了一下《反基督者》哲学意象很多,很难懂,压抑略惊悚,有些镜头至今还有心理阴影。 对宗教,哲学有兴趣的可以挑战一下

  • 查看你常用的 10shell 命令? at June 30, 2013
    1911 git
    658 ls
    532 cd
    515 curl
    368 rm
    308 vim
    241 cat
    240 kill
    221 gco
    211 bundle
    
  • 能谈谈你们现在的服务器环境和部署方式吗? at June 19, 2013

    openjdk + torquebox + capistrano

  • 不敢相信这是真的:这样的女程序猿。 at June 10, 2013

    摸摸点赞

  • 突然有了一种为全世界人民学习 Rails 做了贡献的感觉啊……嘿嘿! at June 08, 2013

    Cool

  • 大家帮我送祝福吧 at May 30, 2013

    展示的时候,文字没有换行

  • 相处很久的女朋友和别人在一起了,有经验的人有没有?出来安慰我两句 at May 24, 2013

    #15 楼 @cod7ce 转移注意力,让自己忙起来

  • 相处很久的女朋友和别人在一起了,有经验的人有没有?出来安慰我两句 at May 24, 2013

    相比安慰来说,你更需要的是时间 楼主保重,都会过去的

  • 四川大学软件学院大三学生求 Web 开发相关的工作 (已结帖) at April 22, 2013

    虽然说精通二字略刺眼 但是作为一个大三在校生,有这样的技术和项目经验的确很赞~ 👍

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 20, 2013

    #30 楼 @phpnew 啊哈,客气~ 在看《Shameless》😄

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    #28 楼 @phpnew ok 那就没有问题了 500 错误,看 rails 日志吧

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    #26 楼 @phpnew 更正一下,rails 项目是否处理静态文件请求和配置有关 如: production.rb 中的配置:

    # Disable Rails's static asset server (Apache or nginx will already do this)
    config.serve_static_assets = false
    

    不建议用 unicorn 处理静态文件

    you generally want to serve static files with nginx since neither Unicorn nor Rainbows! is optimized for it at the moment

    RAILS_ENV=production bundle exec rake middleware
    
    use Rack::Cache
    use Rack::Lock
    use #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x00000004054de0>
    use Rack::Runtime
    use Rack::MethodOverride
    use ActionDispatch::RequestId
    

    可以看到,rails 没有启用ActionDispatch::Static middleware

    启动脚本参考这个链接:因为可能会涉及到RVM和bundler环境的配置 http://blog.kiskolabs.com/post/722322392/unicorn-init-scripts

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    访问 5000 端口,就不是 nginx 配置问题了 所有路径都 404? public/robots.txt 是否存在?

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    #19 楼 @phpnew 访问其他的 GET 路径试一试

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013
    kill -0 1341
    

    如果进程不存在就把 /home/rails/hellworld/tmp/pids/unicorn.pid 文件删除,在重新启动

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    @phpnew 重新排版一下先

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    Already running on PID:1226 就是说 unicorn 已经可以启动咯?

    ps aux|grep unicorn_rails
    

    如果已经确认启动,

    curl www.ruby1.com:5000
    

    如果无法访问,查看一下 unicorn.log 和 production.log,看看是否有错误 如果可以访问,就是 nginx 反向代理配置出了问题

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    #10 楼 @phpnew 因为你/etc/init.d/目录下没有写 unicorn 的启动脚本,所以识别不了这个服务

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    #9 楼 @phpnew 为什么不把 unicorn 添加到 Gemfile?重新bundle install

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    #6 楼 @phpnew unicorn 没有启动

    RAILS_ENV=production bundle exec unicorn_rails -c config/unicorn.rb -E production -D
    
  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    #2 楼 @phpnew

    curl -I www.ruby1.com:5000
    

    和

    ps aux|grep unicorn_rails
    

    结果贴上来 (先查看一下:log/unicorn.log 日志)

  • Ubuntu Server + nginx + unicorn 遇到问题 at April 19, 2013

    www.ruby1.com:5000是否正常?

  • open-uri 的 open 方法获取 url 时报错 at March 25, 2013

    #7 楼 @tianshuai 网络连接方面的异常主要包括ConnectionFailed、TimeoutError等,其他视应用而定

  • open-uri 的 open 方法获取 url 时报错 at March 25, 2013
    response = Faraday.get('http://ruby-china.org/topics/9738')
    case response.status
    when 200
      @html = response.body
    when 301..302
      @html = Faraday.get(response[:Location])
    end
    doc = Nokogiri::HTML(@html)
    

    @tianshuai

  • open-uri 的 open 方法获取 url 时报错 at March 25, 2013

    可以使用Faraday,然后根据 Response 的 Status 来判断、处理

    Faraday.get('http://ruby-china.org/topics/9738')
    
  • 查看日志,发现很多 warn,类似这样的 an upstream response is buffered to a temporary file /tmp/passenger-standalone.10790 at March 07, 2013

    增加client_body_buffer_size 试一试

    client_body_buffer_size 1024k;
    proxy_ignore_client_abort  on;
    

    链接

  • 都来聊聊人生污点吧 at January 06, 2013

    线上 Rails Console 下跑一段代码。。删除了所有的 User 数据。。。 吓尿后,通过 mysql binlog 恢复了数据。。。 然后才知道 Rails Console 有沙箱模式 So

    Learning from mistakes
    
  • ruby 中这个符号什么作用 << at December 17, 2012

    here document

    str = <<EOF
                       /'.    .'\
                       \( \__/ )/
                 ___   / (.)(.) \   ___
            _.-"`_  `-.|  ____  |.-`  _`"-._
         .-'.-'//||`'-.\  V--V  /.-'`||\\'-.'-.
        `'-'-.// ||    / .___.  \    || \\.-'-'`
              `-.||_.._|        |_.._||.-'
                       \ ((  )) /
                   jgs  '.    .'
                          `\/`
    EOF
    
  • 安装 nokogiri Failed to build gem native extension at October 19, 2012

    Check the mkmf.log file for more details.

  • 1
  • 2
  • Next
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English