Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
kakaxi2
@kakaxi2
会员
第 18188 位会员 / 2015-04-14

上海
8 篇帖子 / 17 条回帖
0 关注者
0 正在关注
2 收藏
数据库很远
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 一个 shell 运算的语法小问题,求解答一下 at 2015年10月19日

    #3 楼 @luikore 恩恩,不知道有这样的官档,谢谢了

  • 一个 shell 运算的语法小问题,求解答一下 at 2015年10月19日

    #1 楼 @luikore OK,谢谢了

  • 对于继承了 ActiveRecord::Base 来创建模型的类,想要修改对应字段的 set 和 get 方法 at 2015年10月05日

    #1 楼 @chenge 修改了一下,调用了 super 方法,但是能够设置 password,但是 valid?为 false,无法提交

  • 关于 Rails 的数据库配置文件 database.yml 当中,Yaml 的表达式解释的问题,查阅了一些资料还是没有了解 at 2015年10月04日

    #1 楼 @lgn21st 谢了

  • 《提问的智慧》 at 2015年09月22日

    牛逼

  • 关于一个 Sed 命令的,谁能来解释一下 at 2015年09月15日

    #5 楼 @schwinn 刚看了一下手册:The syntax of the s (as in substitute) command is‘s/regexp/replacement/flags’. The / characters may be uniformly replaced by any other single character within any given s command. The / character (or whatever other character is used in its stead) can appear in the regexp or replacement only if it is preceded by a \ character. 所以应该是以 s 后面的字符作为分隔符

  • 关于一个 Sed 命令的,谁能来解释一下 at 2015年09月15日

    #3 楼 @crazyjacky sed 里面一般见到的都是 s///g 模式,怎么还有 s|||g 这样的模式啊?

  • 关于一个 Sed 命令的,谁能来解释一下 at 2015年09月15日

    #1 楼 @leopku 整个的脚本如下:

    #!/bin/bash
    if [ $# -ne 3 ];
    then
     echo "Usage: $0 URL -d DIRECTORY"
     exit -1
    fi
    
    for i in {1..4}
    do
     case $1 in
     -d) shift; directory=$1; shift;;
        *) url=${url:-$1};shift;
    esac
    done
    
    mkdir -p $directory
    baseurl=$(echo $url | egrep -o "https?://[a-z.]+")
    
    echo "$baseurl"
    
    curl -s $url | egrep -o "<img src=[^>]*>" |
    sed 's/<img src=\"\([^"]*\).*/\1/g' > /tmp/$$.list
    
    sed -i "s|^/|$baseurl/|" /tmp/$$.list
    cd $directory;
    
    while read filename
    do
     curl -s -O "$filename" --silent
    done < /tmp/$$.list
    
  • Nginx + Passenger 部署 Rails, 希望能够直接访问 Rails 的 public 目录的静态文件,但是 Nginx 总是返回 404 at 2015年08月10日

    #8 楼 @cxh116 谢谢你的回帖,确认是你说的额用户问题,修改 nginxuser,问题得到修正。 总结,由于在测试访问 abc.html 的过程中,对 nginx 的相应 403 forbidden 没有理解清楚,也咩有仔细查看 nginx error 日志,里面记载了 denied 相关消息。linux 下访问权限的问题一定要谨记。

  • Nginx + Passenger 部署 Rails, 希望能够直接访问 Rails 的 public 目录的静态文件,但是 Nginx 总是返回 404 at 2015年08月09日

    #2 楼 @appell 作用我也不是很了解,另 public 的目录确实访问不到

  • Nginx + Passenger 部署 Rails, 希望能够直接访问 Rails 的 public 目录的静态文件,但是 Nginx 总是返回 404 at 2015年08月09日

    #4 楼 @springwq public 目录访问需要加/public 么

  • Nginx + Passenger 部署 Rails, 希望能够直接访问 Rails 的 public 目录的静态文件,但是 Nginx 总是返回 404 at 2015年08月09日

    #1 楼 @springwq 请求 localhost/abc.html application.log 返回

    INFO -- : Started GET "/abc.html" for 127.0.0.1 at 2015-08-09 21:31:25 +0800
    ActionController::RoutingError (No route matches [GET] "/abc.html"):
      actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
      actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
      railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
      railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
      activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
      activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
      activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
      railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
      actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
      rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
      rack (1.6.4) lib/rack/runtime.rb:18:in `call'
      activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
      rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
      railties (4.2.3) lib/rails/engine.rb:518:in `call'
      railties (4.2.3) lib/rails/application.rb:165:in `call'
      rack (1.6.4) lib/rack/lock.rb:17:in `call'
      rack (1.6.4) lib/rack/content_length.rb:15:in `call'
      rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
      /home/sdy/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
      /home/sdy/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
      /home/sdy/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
    
  • 初学者的关于部署 Rails 的问题 at 2015年08月09日

    #5 楼 @ibugs 恩恩

  • MySQL 为什么需要一个主键 at 2015年07月29日

    #23 楼 @ibugs 兄弟,好像不是啊

  • MySQL 为什么需要一个主键 at 2015年07月28日

    #16 楼 @ibugs 你说的这个场景确实是使用自增主键的一个好的例子。但是大部分时候,如果你用 InnoDB,而且不需要特殊的聚簇索引,一个好的做法就是使用代理主键 (surrogate key)——独立于你的应用中的数据,就是使用一个 AUTO_INCREMENT 的列,这会保证记录按照顺序插入,这是因为 InnoDB 使用的是聚簇索引

  • MySQL 为什么需要一个主键 at 2015年07月27日

    如果使用自增长列作为主键,在查询上是不能利用到索引的优势的。因为你基本上不会用到自增列作为查询的条件。更多时候你可以考虑不会经常改变的列来作为索引,楼主说的应该说明限制条件。

  • 初学者的关于部署 Rails 的问题 at 2015年07月14日

    #1 楼 @046569 会导致什么样的问题呢?比如安全上的

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