161107 11:54:36 [Note] /usr/sbin/mysqld: Normal shutdown
161107 11:54:36 [Note] Event Scheduler: Purging the queue. 0 events
161107 11:54:36 InnoDB: Starting shutdown...
161107 11:54:38 InnoDB: Shutdown completed; log sequence number 7538250
161107 11:54:38 [Note] /usr/sbin/mysqld: Shutdown complete
161107 11:54:38 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
161107 11:54:40 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
161107 11:54:40 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
/usr/sbin/mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2)
161107 11:54:40 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files
161107 11:54:40 [ERROR] Aborting
161107 11:54:40 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
161107 11:59:03 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
161107 11:59:03 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
/usr/sbin/mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2)
161107 11:59:03 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files
161107 11:59:03 [ERROR] Aborting
161107 11:59:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
161107 12:07:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
161107 12:07:20 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
/usr/sbin/mysqld: Error on realpath() on '/var/lib/mysql-files' (Error 2)
161107 12:07:20 [ERROR] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files
161107 12:07:20 [ERROR] Aborting
161107 12:07:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Прежде всего нужно понять, что вы вообще хотите получить от запроса? Сформулируйте, пожалуйста, простыми словами и озвучьте.
.sort_by { |item| item. position }.reverse.uniq! { |item| item. post_id }
Вкратце, что там из коробки доступно и что придется докупать? Без особого фанатизма, только самое основное.