...e.g. rails console staging Gem updates Replace ruby-debug with byebug or pry Replace mysql with mysql2, '< 0.3' Remove oniguruma Remove net-ssh and net-scp Remove fastercsv Remove cucumber...
In the tradition of our PostgreSQL cheat sheet for MySQL lamers, here is a cheat sheet for Jasmine when you're used to RSpec. Note that Jasmine syntax has changed...
...to migrate to Minidusen, which extracts those parts from Dusen. Minidusen is compatible with MySQL, PostgreSQL and Rails 3.2, 4.2 and 5.0. If you are looking for a full text...
...I measured the runtime of different strategies using an average-sized Rails project (with MySQL): Cucumber RSpec Transaction 87.14, 86.65 10.20, 10.11 Truncation 90.43, 90.69 26.82, 26.46
This is an extension to PostgreSQL vs MySQL: How to UPDATE using a JOIN. UPDATE employees SET department_name = departments.name, department_area = areas.name FROM departments, areas WHERE employees.department_id = departments.id...
...second SELECT statement with a subselect. Note that sub-queries are extremely slow in MySQL, but they can make cases easier where performance does not matter so much (e.g. a...
...BigDecimal('12.3413') gross = net * VAT_RATE # gross is now a BigDecimal ActiveRecord models represent MySQL's DECIMAL columns as BigDecimal attributes. Keep in mind that values assigned to such attributes...
...supported; consistently good performers; failure free as possible; free. Using these criteria they selected: MySQL, Solr, Memcache, and Redis. Cassandra and Mongo were dropped...
...have existing data that needs to be cleaned, do it in a migration, using MySQL's TRIM function: class StripWhitespaceFromOrganisation < ActiveRecord::Migration def change update 'UPDATE organisations SET name = TRIM...
...ruby-debug and use e.g. byebug Remove gem oniguruma Remove gem fastercsv Replace gem mysql with mysql2 Update gem capistrano 2.12.0 to ~>2.12 when bound for Ruby 1.8.7 and remove...
On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and versions 0.3.x (required for Rails 3.2) can no longer...
...when compiling the native extension, or a segfaults when using it. For Rails 4.2, mysql2 version 0.4.10 seems to work okay. If you still have issues, upgrade to 0.5.x...
On 32bit systems, the maximum representable Time is 2038-01-19 03:14:07 in UTC or 2038-01-19...
Chances are you're seeing the warning repeated a lot of times, maybe thousands of times. Here's how to...
The mysql2 gem in version 0.3.13 might break while compiling on older patch releases of Ruby 1.9.3 within rvm: *** [err :: server] ruby: symbol lookup error: /path/to/deployment/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.13/lib/mysql2/mysql2.so: undefined symbol: rb_wait...
...server] ruby: symbol lookup error: /path/to/deployment/shared/bundle/ruby/1.9.1/gems/mysql2-0.3.13/lib/mysql2/mysql2.so: undefined symbol: rb_wait_for_single_fd Fixating mysql2 to version 0.3.11 helped...
When doing a query like this: SELECT id FROM users WHERE (users.id IN (899,1084,1095,100,2424,2429,2420...
...Spreewald database.sample.yml has changed) Fix Change cucumber to test in your databse.yml test: # <--- adapter: mysql2 database: spreewald_test encoding: utf8 host: localhost username: root password: password
There is a bug in Rails 3's dbconsole script, which makes the following command open a database console for...
This error can be caused by the mysql2 gem under mysterious circumstances. You need to remove it with gem uninstall mysql2 and then reinstall it (or just run bundle).
...pristine mysql2 will not be enough...
...technical tasks which cannot be directly linked to customer value. Things like “Upgrade to MySQL 6.0″ or “replace magic numbers with enums” need to be done. How can you prioritize...
One useful postgres command I stumbled upon recently was \x. It gives you an expanded display which allows you to...
This sounds promising: The best part from the Rails side, is that you don’t have to change anything at...
Best results in other decks
NAME W STATUS CHECK ACT BCK QCUR QMAX SCUR SMAX SLIM STOT >>> mysql-front FRONTEND 0 OPEN 0 0 0 0 0 0 75 0 >>> mysql-back...
...hatop and pressing F10. Via socat it works this way: # disable server / echo "disable server mysql-back/mysql1" | socat unix-connect:/var/run/haproxy/haproxy.stat stdio Now no new connections will be opened...
The Oracle mysql client has an odd behavior if your server uses latin1 as default character-set-server. Command mysql --version mysql Ver 8.0.31-0ubuntu0.20.04.2 for Linux on x86...
mysql --default-character-set utf8mb4 -e "SHOW VARIABLES LIKE '%char%';" Expectation utf8mb4 will be used as character set in this session. Reality The mysql client falls back to latin1...