A few things have changed under the hood since the release of Bundler 2 last year. In order to take advantage of the new version, you will need to make sure you are using the most recent version. Open your Gemfile.lock and see that the current bundler version stored at the end of the file. … Continue reading Bundler version update in Gemfile.lock
Tag: ruby on rails
Rails ships with an easy way to get some quick code metrics about your application’s code and test coverage. For instance, running bin/rails stats will provide you with some important bits of information about the status and health of your project: +———————-+——–+——–+———+———+—–+——-+ | Name | Lines | LOC | Classes | Methods | M/C | … Continue reading Extend Rails code metrics
Let’s say you’re using Docker for your local development in order to keep your development system nice and clean. Not having to install all needed dependencies on your local machine (like for instance PostgreSQL) and have everything packaged and documented for all developers is one of the advantages containers bring us. But when developing in Rails, … Continue reading How to install ruby pg gem without PostgreSQL locally
How do you prevent your application to deteriorate over time? Or even improve your coding skills? That’s a question a lot of developers ask. I like to include some handy tools that help me check the state of an application and code. Since everything is changing so rapidly, it is sometimes hard to keep up with … Continue reading Useful Ruby gems to improve your code quality and skills
When working on a CRUD based application, starting with the index view, you’ll want to display a collection. But when the collection is empty, you’ll want to let the user know the collection is empty, by showing a message. Most common scenario I have seen so far is the following construction: <% if @collection.length > … Continue reading Rails: display message when collection is empty
Although this might seem a common practice, you would be surprised how many times I come across projects that contain passwords and tokens. When connecting your application tot 3rd party services or even simpler than that, do you commit your production database settings in your repository ass well? Do all team member need access to … Continue reading Don’t commit sensitive data
If you’re like me, tailing your development log might provide you with some useful information. The thing I like the most is viewing the details of the queries that happen in the background while you are using your application. But one thing that makes it harder to keep a proper view on the data that … Continue reading Turn off asset logging in your Rails application
“Release early, release often”, a philosophy that emphasizes the importance of early and frequent releases in creating a tight feedback loop. I’ve been trying to push my code to production as often as possible. But I’ve been having a problem with the asset pipeline. From the moment Capistrano hits the deploy:assets:precompile task, it might take … Continue reading Faster Capistrano deployments
Deployments are a critical phase in any software project. I can still remember the time where I needed to deploy code changes to production using nothing more than FTP to upload all the changed files. Oh boy, the elevated heart rate, logged in on the production server to intervene when something went wrong. From time … Continue reading Deployments automation with Capistrano
I came across this quick tip on how to reduce the size of your Rails log files. Over time, the development and test log might get bigger and bigger. A quick solution is to rotate your logs through the Rails Logger: config.logger = Logger.new(Rails.root.join(“log”,Rails.env + “.log”), 3, 5*1024*1024) This will rotate your log files every … Continue reading Rails Logger