Miniposts

38 miniposts
Ruby

How to interpolate a Ruby Symbol

One tricky part in terms of its syntax, is the interpolation of a Ruby Symbol. This minipost aims to demonstrate Ruby Symbol interpolation and also how to add a space between two seperate words on a Ruby symbol declaration.

Ruby on Rails

rbenv: bundle: command not found

When you get the rbenv: bundle: command not found error it is most likely the case that you have installed a new Ruby version and you are trying to run a bundle command inside an existing project directory. For every new Ruby version you install, you also need to install the Bundler gem. This minipost will help understanding the case.

Devops

Dokku deployment error: You must use Bundler 2 or greater with this lockfile.

When deploying on a dokku server with herokuish and default buildpacks, If your Ruby on Rails application was bundled with Bundler version 2+, your console might throw the following error You must use Bundler 2 or greater with this lockfile, resulting in deployment failure. This minipost will demonstrate, how to configure a buildpack for a Ruby on Rails project on a dokku server, that can handle Bundler version 2+ and successfully deploy the application.

Ruby on Rails

How to permit all parameters in Rails controller strong parameters

Sometimes, you are looking to permit all the parameters of your Rails model in controller strong parameters. Instead of specifying them explicitly, one by one, you can permit all of the model attributes. However, this is not a good practice for a production application. As the comment of the rails controller scaffold states as a reminder to: Never trust parameters from the scary internet, only allow the whitelist through.

Ruby

How to update your rbenv version with git

This minipost will demonstrate how to update rbenv version when you have installed it through git to your system. To be more specific, we will update rbenv from version 1.1.0 to version 1.1.1 via git pull.