Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
@suupic
VIP
NO. 145 / 2011-11-21

70 Topics / 481 Replies
2 Followers
0 Following
200 Favorites
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • [北京][2012年2月21日] Ruby Tuesday 第 0 场 (活动地点已更新) at February 21, 2012

    报名

  • 刚看到的一个网站:Ruby/Rails 工程师招聘网 at February 14, 2012

    访问有问题,翻墙到 linode 才打开

  • 穿越到 ruby-taiwan,附身到了另一个同学身上... at February 14, 2012

    注销后再次尝试,没有重现

  • 大家来分析下各种云的价格 at February 14, 2012

    #2 楼 @gazeldx 盛大是流量计费,阿里云是带宽计费,看你自己需要,没有哪家云计算能满足所有需求

  • 大家来分析下各种云的价格 at February 14, 2012

    计费方式要么流量要么带宽,各有利弊,选择自己适用的 流量计费对大多数应用来说很合适,比如不需要为 2 个小时的访问峰值支付一整天的钱

  • 喜欢 Ruby 主要原因是什么啊? at February 14, 2012

    行云流水一般流畅,很舒服

  • Mongoid: find 和 where 有哪些区别? at February 13, 2012

    find 找不到会报错 where 找不到会返回空记录

  • 庆祝社区人数突破 1000!!! at February 13, 2012

    145 号

  • 代码托管服务 GitCafe 正式上线 at February 04, 2012

    求邀请码 另外想问一句:支持私有仓库吗?

  • 请问盛大云的公网 ip 是什么? at January 30, 2012

    至少得有一个,不然你怎么访问呢?

  • 在中国,有没有比较好的从服务器发送短信的解决办法? at December 29, 2011

    搜短信接口,有很多

  • 关于删除问题 at December 29, 2011

    #3 楼 @zhangyuan 如果是 rails 3.1,在生产环境部署的话,由于 asset pipeline 的缘故,需要先 rake assets:precompile 编译一下 js 和 css,否则 application.js 是没有加载的

  • many-to-many-to-many 的关系应该怎么写? at December 27, 2011

    原来我用:through 一直报错是因为 mongoid 没有实现这个特性 最后参考http://groups.google.com/group/mongoid/browse_thread/thread/fd2b57f9118376c4/87730bec244a9d8c?lnk=gst&q=through#87730bec244a9d8c 解决了问题

    模型关系大致如下

    class Plan
      has_and_belongs_to_many :group
    
      def users
        group.collect { |t| t.user rescue nil }
      end
    
    class Group
      has_and_belongs_to_many :plan
      has_and_belongs_to_many :user
    
    class User
      has_and_belongs_to_many :group
    

    可以用 plan.users 获取 plan 所有 group 下的用户

  • CSDN 600w 用户导入数据库,你的要多久 at December 24, 2011

    我用 mongoid 保存处理 csv 的记录,也就几百条/秒,确实不快。

  • 现在起,改用国内镜像服务器来装 Gem 吧 at December 23, 2011

    太感谢了

  • 哪位能推荐个 ror 主机? at December 22, 2011

    盛大云

  • 万恶的邮件系统,再次提问:Resque 如何控制 jobs 运行频率 at December 22, 2011

    #1 楼 @Psi 太感谢了,找来试试

  • ActionMailer 的 execution expired 怎么解决? at December 22, 2011

    #1 楼 @huacnlee 内部系统,放在 nginx 后面的内网主机里,可以通过连接公网的 smtp 服务器发信,但 sendmail 就不行了。

    问题就是如果用 smtp 的话,有时会出现连接超时,一个大 job 执行一半断掉了

  • simple_form+mongoid 表关联遇到问题 at December 21, 2011

    console 里关联关系无异常

    Reloading...
    => true
    irb(main):097:0> u=User.new 
    => #<User _id: 4ef1bd5d53cd2108dd000008, _type: nil, created_at: nil, updated_at: nil, name: nil, email: nil, mobile: nil, tel: nil, alias: nil, birthday: nil, second_email: nil, address: nil, company: nil, memo: nil, plan_ids: [], group_ids: []>
    irb(main):098:0> g=Group.new
    => #<Group _id: 4ef1bd6753cd2108dd000009, _type: nil, created_at: nil, updated_at: nil, name: nil, user_ids: []>
    irb(main):099:0> u.group << g
    => []
    irb(main):100:0> u.group
    => [#<Group _id: 4ef1bd6753cd2108dd000009, _type: nil, created_at: nil, updated_at: nil, name: nil, user_ids: [BSON::ObjectId('4ef1bd5d53cd2108dd000008')]>]
    irb(main):101:0> g
    => #<Group _id: 4ef1bd6753cd2108dd000009, _type: nil, created_at: nil, updated_at: nil, name: nil, user_ids: [BSON::ObjectId('4ef1bd5d53cd2108dd000008')]>
    irb(main):102:0> 
    
  • simple_form+mongoid 表关联遇到问题 at December 21, 2011

    换了 formtastic 也有同样的问题 看起来是 mongoid 哪里不对劲

  • Rails 4.0.0.beta 来了。。。 at December 21, 2011

    4.0 会有什么 nb 的特性?

  • 盛大云终于有 Ubuntu 10.04 镜像了 at December 21, 2011

    10.04 还是有点老..

  • 请问 self-join 的问题。实现 twitter 的 follower 和关注 at December 19, 2011

    我用 mongoid 的写法

    has_and_belongs_to_many :following, 
                            :class_name => 'User', 
                            :inverse_of => :followers
    has_and_belongs_to_many :followers, 
                            :class_name => 'User', 
                            :inverse_of => :following
    
  • 开发环境 asset pipeline 如何实时更新? at December 17, 2011

    #7 楼 @Rei
    解决了! 原因是在我的 nginx 的配置中有这样一段

    location ~ ^/(assets|images|javascripts|stylesheets|system)/  {
        root   /opt/dev/dreamworks/weibo/public/;
        expires max;      
        break;    
    }
    

    让 assets 的文件由 nginx 处理,不发送到后端的 unicorn。

    这个配置在生产环境没有问题,但对开发环境来说,需要注释掉上面那段 location,再给 development.rb 中加入 config.serve_static_assets = true 这样来让 unicorn 处理 assets 的请求

  • 开发环境 asset pipeline 如何实时更新? at December 17, 2011

    补充:页面中正确的引入了 css/js,但是渲染模板的时候,日志中并没有任何关于 assets 文件的记录,干干净净。

  • 开发环境 asset pipeline 如何实时更新? at December 17, 2011

    请求路径是正确的,说明'sprockets/railtie'被加载了 但是不知道为什么不能生成文件

  • 开发环境 asset pipeline 如何实时更新? at December 17, 2011

    @Psi 我做了 2 个 diff,没有发现那里不对..T 项目是 rails new 出来的,没做修改

    ** diff config/application.rb /opt/dev/t/config/application.rb **

    < #require 'rails/all'
    < #
    < #用于mongoid
    < require "action_controller/railtie"
    < require "action_mailer/railtie"
    < require "active_resource/railtie"
    < require "rails/test_unit/railtie"
    < #用于assets pipeline
    < require 'sprockets/railtie'
    < #队列服务
    < require 'resque/server'
    ---
    > require 'rails/all'
    22c12
    < module Weibo
    ---
    > module T
    44,45c34
    <     # config.i18n.default_locale = :en
    <     config.i18n.default_locale = :zh_CN    
    ---
    >     # config.i18n.default_locale = :de
    58,60d46
    < 
    <     #Used for Devise
    <     config.action_mailer.default_url_options = { :host => "yourdomain.com" }
    

    *diff config/environments/development.rb /opt/dev/t/config/environments/development.rb *

    1c1
    < Weibo::Application.configure do
    ---
    > T::Application.configure do
    30d29
    <
    

    为了 resque/server, config.ru 改成了

    require ::File.expand_path('../config/environment',  __FILE__)
    run Rack::URLMap.new "/" => Weibo::Application, "/resque" => Resque::Server.new
    
  • 开发环境 asset pipeline 如何实时更新? at December 17, 2011

    #2 楼 @Rei
    #1 楼 @Psi

    之前已试过删除 public/assets 删掉后 application.css/js 都是 404 对比过新建项目的 development.rb,是一致的 我用的是 twitter-bootstrap-rails,不知道跟这个有没有关系

  • 想在盛大云上玩一玩,但是没有经验 at December 17, 2011

    就是个远程虚拟机,没啥特别的。盛大云也有文档 注意一下安全组的配置,否则有些服务连不上

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