难得
路过~
顶一下👍👍
读后感:砸锅卖铁上了个 5w 的培训课,写了个 Blog,值吗?
#3 楼 @lyfi2003 我没有再 nginx 里配置 ssl,公司用的 LVS 统一做 ssl 认证 我再具体描述一下吧,以下是 rubychina 的例子,没有登录时,当访问 edit,会 302 跳到https://ruby-china.org/account/sign_in
Request URL:https://ruby-china.org/account/edit
Request Method:GET
Status Code:302 OK
location:https://ruby-china.org/account/sign_in
我这里就会先跳到 http://ruby-china.org/account/sign_in 再跳 https://ruby-china.org/account/sign_in
我想问的是 redirect 302 跳转 需要如何直接跳转到 https
再来两斤花椒
赞刘总
虽然有点少,不过还是要支持
项目不一定用,但是研究源码值的👍
32 个赞~
ppt 上 ActionCable 没什么东西 不录视频真可惜
赞 remote!
可以对比两个项目分支嘛?
👍👍👍
log
ArgumentError: comparison of Fixnum with nil failed
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/protocol/message.rb:117:in `>'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/protocol/message.rb:117:in `deserialize'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/server/connectable.rb:107:in `block in read'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/server/connectable.rb:91:in `ensure_connected'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/server/connectable.rb:106:in `read'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/server/connection.rb:180:in `deliver'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/server/connection.rb:125:in `block in dispatch'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/monitoring/publishable.rb:47:in `publish_command'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/server/connection.rb:124:in `dispatch'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/operation/executable.rb:36:in `block in execute'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/server/connection_pool.rb:108:in `with_connection'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/server/context.rb:63:in `with_connection'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/operation/executable.rb:34:in `execute'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/database.rb:158:in `command'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/collection/view/readable.rb:136:in `block in count'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/retryable.rb:51:in `call'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/retryable.rb:51:in `read_with_retry'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongo-2.2.1/lib/mongo/collection/view/readable.rb:135:in `count'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongoid-5.0.0/lib/mongoid/contextual/mongo.rb:59:in `block in count'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongoid-5.0.0/lib/mongoid/contextual/mongo.rb:489:in `try_cache'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongoid-5.0.0/lib/mongoid/contextual/mongo.rb:59:in `count'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongoid-5.0.0/lib/mongoid/contextual.rb:20:in `count'
from /Users/abc/.rvm/gems/ruby-2.2.1/gems/mongoid-5.0.0/lib/mongoid/findable.rb:54:in `count'
rails g model teacher name:string
rails c
Teacher.count
报错如下: DEBUG -- : MONGODB | xxxxx:27018 | test_development.count | FAILED | comparison of Fixnum with nil failed | 0.008398999999999998s ArgumentError: comparison of Fixnum with nil failed
我自己本地的 db.version 是 3.0.7 , 项目中没有升级过,是 2.0.6
> db.version()
3.0.7
>
> db.col.insert({title: 'MongoDB 教程',
... description: 'MongoDB 是一个 Nosql 数据库',
... by: '菜鸟教程',
... url: 'http://www.runoob.com',
... tags: ['mongodb', 'database', 'NoSQL'],
... likes: 100
... })
WriteResult({ "nInserted" : 1 })
> db.version()
2.0.6
> db.col.insert({title: 'MongoDB 教程',
... description: 'MongoDB 是一个 Nosql 数据库',
... by: '菜鸟教程',
... url: 'http://www.runoob.com',
... tags: ['mongodb', 'database', 'NoSQL'],
... likes: 100
... })
Cannot use commands write mode, degrading to compatibility mode
WriteResult({ "nInserted" : 1 })
通过命令行插入时,会有一个警告,但也会插入成功,如果使用 rails console 就会报错,不知道是否跟 mongo server 的版本有关 ,升级了 rails 版本到 4.2.5,和 mongoid 到 5.0.0,但是 mongo server 的版本是 2.0.6 不知道是否跟 mongo server 的版本有关 ruby china 在升级的时候,有没有遇到这个问题?
#6 楼 @qinfanpeng 不注释不行,不 require active_record 找不到 active_record 方法