• Category Archives: Default

Ruby on Rails, Mysql2::Error: Incorrect string value: ‘\xF0\x9F\x99\x82’ and Specified key was too long; max key length is 767 bytes

If you get error like this one: it means that you use verion of Mysql with settings that does not support full Unicode. Changing that in Ruby on Rails should be fairly simple: However you might encounter following error: 767 bytes is the stated prefix limitation for InnoDB tables. To fix that you need to: […]

Read more at the source

Trailblazer + Devise: Integrating Devise validatable model with Trailblazer operation + error propagation

Devise is one of those gems that are tightly bound to the Rails stack. It means that as long as you follow the “Rails way” and you do things the recommended way, you should not have any problems. However, Trailblazer is not the recommended way and the way it works, not always makes it painless […]

Read more at the source

Gitlab, Ruby private repository, Docker container and safe way to add SSH key for build process only

Note This is not a tutorial on how to use Docker with SSH keys and private repositories. This is a solution to a particular safety issue when building Docker containers. I won’t get into details on how to create a Dockerfile with a SSH key, etc – there’s enough about that in the Internet. Problem […]

Read more at the source

Tracking Sidekiq workers exceptions with Errbit/Airbrake

If you’ve set up Errbit/Airbrake and you use Sidekiq, by default you would expect, that Errbit tracks things that happen in Sidekiq workers as well. Unfortunately it doesn’t. In order to make Sidekiq retry failed jobs in needs to catch and handle exceptions on its own. And that’s the reason why you need a bit […]

Read more at the source

Multiple Sidekiq processes for multiple Rails/Sinatra applications – namespacing

Sidekiq is a great background processing tool that can be used with many applications deployed on the same server. In order to make it work without any issues or collisions, you need to define namespace for each Sidekiq process group within single application. To do so, you need to create an initializer that will contain […]

Read more at the source

Upgrading to Rails 4.1 from Rails 4.0 – Ruby on Rails

Upgrading to Ruby on Rails 4.1 was much easier than moving from 3.2 to 4.0. Maybe because I try to keep all the apps up-2-date, maybe because Rails guys didn’t change much stuff ;) (or maybe both). Either way, lets get through it. Paperclip – String based terminators are deprecated, please use a lambda Well […]

Read more at the source

Rack/Ruby on Rails: ArgumentError: invalid byte sequence in UTF-8

# Quick test – just copy-paste this: ?%28t%B3odei%29 into your app url – if app crashes, you should read stuff below ;) If you’re here, than probably you’ve encountered this weird issue: you might even have a backtrace like this: First of all, this issue is not super-important. It’s not a security issue as well. […]

Read more at the source

Ruby on Rails: RailsAdmin + HTTP Basic authentication

RailsAdmin is an awesome gem when you want to build a not-so-much custom admin panel. Unfortunately it’s not mentioned in documentation (or at least I couldn’t find it) how to use it with HTTP Basic authentication. Here is an example of how to do this (put this in your config/initializers/rails_admin.rb file): You should also use […]

Read more at the source
close