If you are deploying Ruby web application on Fedora with Puma (or other) application server and Nginx web server as a proxy, you might encounter SELinux forbidding Nginx to use the Puma socket. Here is how to create a SELinux policy module that you can use during your server provisioning.
If you are using Rails with
activerecord-postgis-adapter 3.1.4 perhaps you got into a point where you were suddenly getting the following error:
can't cast RGeo::Geographic::SphericalPointImpl to point
Build your Ruby application’s Docker image in just one line of code without writing any Dockerfile! You only need source-to-image tool (s2i, formally sti) and Docker. Continue reading
What to do when running Vagrant with
--debug flag is not enough? As Vagrant is nothing else than a Ruby program, you can use famous
pry gem together with
pry-byebug to debug it. The only thing you need to do to use
pry from the Vagrant code base is to make sure it’s installed and available in the Vagrant environment. Continue reading
How to change pages’ URLs in Jekyll using a custom generator plugin.
Have you ever wanted to use Bundler’s internals in your codebase? Here is how how to start by creating your Gemfile.lock, locking the environment and reading back the locked dependencies.
gem-patch is a RubyGems plugin that helps you to patch gems. You can use it to apply security fixes or cherry-pick commits you want to apply to your .gem files. I use it to test whether the upstream commits containing vulnerability fixes apply cleanly on older gem releases so I can prepare fixed builds of those gems in Fedora. Here is how one can do that. Continue reading
What do you usually do when releasing a new version of gems? Running test suite? Something more? I like to use my tool on tracking changes in RubyGems gem-compare as it gives me a little bit more confidence on what am I actually releasing. Here’s how I do it. Continue reading
As you probably know, you can use
eval() to evaluate Ruby code from Ruby. But evaluating things that come from the outside of the program like user inputs can be dangerous. Why they can be dangerous you ask?
eval() evaluates anything as we would program it ourselves. Basically anything can happen. That’s why it’s best to avoid
eval() for such inputs altogether. But we can evaluate Ruby in a safer manner too; with
$SAFE. Continue reading
Sometimes it happens that you want to run an old test suite, but you don’t have a correct version of the testing framework available. That happens a lot in Fedora
since tooling around RPM supports only one version of each component and new rubies does not come with
test/unit anymore. As we still need to run the tests, we have two options. Either go ahead and update the whole test suite to a new version or just use Ruby’s dynamic nature to actually run it. Let’s look how the latter can look like. Continue reading