• 关于 Ruby 的正则问题 at 2018年06月14日
    '16DC203B5R'.scan(/(\d+)([a-zA-Z]+)/)
    => [["16", "DC"], ["203", "B"], ["5", "R"]]
    
  • Really young.

  • 有道理,感觉像是在重新编译所有静态资源。

    项目的静态资源很大,可以用“庞然巨物”来形容~

  • 没错assets:precompile导致的,public设置了link_dir,每次编译大约需要5分钟,不知有什么好的解决方法?

    目前解决方法是不使用capistrano编译,写脚本ssh进行编译,大约20s左右。

  • images是表名,单复数根据关联联系决定。

  • Post.includes(:images).find(1).images
    
  • Rails5.0 ~~~,可以兼容到Rails4么

  • Capistrano在执行bundle install时服务器CPU会爆满,请问这个问题怎么解决?

  • 多谢,搞定了,是文件权限问题,mongodb/这个目录的所有者必须是mongodb,可以使用这个命令修复:

    sudo chown -R mongodb:mongodb *
    

    权限改成这样:

    drwxr-xr-x 4 mongodb mongodb 4.0K Mar 20 10:55 mongodb
    
  • 日志内容是这样的,没看出来哪里出错了,请指教🙏

    2018-03-20T10:09:21.433+0800 I CONTROL  [main] ***** SERVER RESTARTED *****
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten] MongoDB starting : pid=17726 port=27017 dbpath=/home/mongodb 64-bit host=smart
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten] db version v3.4.13
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten] git version: fbdef2ccc53e0fcc9afb570063633d992b2aae42
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten] allocator: tcmalloc
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten] modules: none
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten] build environment:
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten]     distmod: ubuntu1604
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten]     distarch: x86_64
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten]     target_arch: x86_64
    2018-03-20T10:09:21.436+0800 I CONTROL  [initandlisten] options: { config: "/etc/mongod.conf", net: { bindIp: "127.0.0.1", port: 27017 }, storage: { dbPath: "/home/mongodb", journal: { enabled: true } }, systemLog: { destination: "file", logAppend: true, path: "/var/log/mongodb/mongod.log" } }
    2018-03-20T10:09:21.460+0800 I -        [initandlisten] Detected data files in /home/sunyudong/database/mongodb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
    2018-03-20T10:09:21.460+0800 I STORAGE  [initandlisten]
    2018-03-20T10:09:21.460+0800 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
    2018-03-20T10:09:21.460+0800 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
    2018-03-20T10:09:21.460+0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3406M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),verbose=(recovery_progress),
    2018-03-20T10:09:21.674+0800 I STORAGE  [initandlisten] WiredTiger message [1521511761:674256][17726:0x7f4c98877d00], txn-recover: Main recovery loop: starting at 11/5632
    2018-03-20T10:09:21.760+0800 I STORAGE  [initandlisten] WiredTiger message [1521511761:760006][17726:0x7f4c98877d00], txn-recover: Recovering log 11 through 12
    2018-03-20T10:09:21.857+0800 I STORAGE  [initandlisten] WiredTiger message [1521511761:857612][17726:0x7f4c98877d00], txn-recover: Recovering log 12 through 12
    2018-03-20T10:09:22.359+0800 I CONTROL  [initandlisten] 
    2018-03-20T10:09:22.360+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
    2018-03-20T10:09:22.360+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
    2018-03-20T10:09:22.360+0800 I CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
    2018-03-20T10:09:22.360+0800 I CONTROL  [initandlisten]
    2018-03-20T10:09:22.365+0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/home/sunyudong/database/mongodb/diagnostic.data'
    2018-03-20T10:09:22.366+0800 I NETWORK  [thread1] waiting for connections on port 27017
    2018-03-20T10:10:48.106+0800 I CONTROL  [signalProcessingThread] got signal 2 (Interrupt), will terminate after current cmd ends
    2018-03-20T10:10:48.106+0800 I NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
    2018-03-20T10:10:48.107+0800 I NETWORK  [signalProcessingThread] closing listening socket: 7
    2018-03-20T10:10:48.107+0800 I NETWORK  [signalProcessingThread] closing listening socket: 8
    2018-03-20T10:10:48.107+0800 I NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
    2018-03-20T10:10:48.107+0800 I NETWORK  [signalProcessingThread] shutdown: going to flush diaglog...
    2018-03-20T10:10:48.107+0800 I FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
    2018-03-20T10:10:48.112+0800 I STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
    2018-03-20T10:10:48.502+0800 I STORAGE  [signalProcessingThread] shutdown: removing fs lock...
    2018-03-20T10:10:48.502+0800 I CONTROL  [signalProcessingThread] now exiting
    2018-03-20T10:10:48.502+0800 I CONTROL  [signalProcessingThread] shutting down with code:0