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 sourceCategory Archives: Default
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 sourceRuby: Dragonfly gem – auto-orient for all the images
Dragonfly is an awesome image/asset management tool. It is great because of many reasons, but what I love the most, is how it handles thumbnails. You don’t need to specify sizes, or anything else in the models in which you use it. Instead every type of thumbnail can be generated “on the fly”, the first […]
Read more at the sourceGitlab, 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 sourceInstalling Rhodes on Ubuntu and making it run on Ruby 2.1
People who want to use Rhodes are recommended to use it under Ruby 1.9.3. But to me it seems kinda old. This is a way to install and run it on 2.1: Oracle Java Oracle Java is a recommended one to use with Rhodes, so just: SDK and NDK Android SDK Android NDK Download both […]
Read more at the sourceTracking 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 sourceMultiple 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 sourceUpgrading 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 […]
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. […]
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