10 must-have Rubygems for Rails web development
Whether you’re looking to create new tools or build upon existing ones, Rubygems is a great way to search and distribute open-source code in Ruby. Here are 10 of the best gems that every Rails developer should know about and use on a regular basis.
As a developer, I can’t live without my error messages. When my code breaks and I get that beautiful, clear error message, it’s as though the universe is telling me to take a break and reevaluate what I’m doing. Error messages are such an important part of the development process that when errors are suppressed by default in rails 4, I think something has gone horribly wrong. Here are 10 gems that will provide you with more informative errors and help make your life as a developer easier.
byebug is a gem that makes debugging Ruby code much easier. It provides single-key shortcuts to stop the execution, rerun your code, or step through your code one line at a time. byebug is handy and can save hours of frustrating debugging.
Capybara is a library used to write acceptance tests in Ruby. It provides a DSL that reduces the amount of code needed to test an application’s features. There are many other gems that can be used with Capybara.
Guard Rubygems for Rails web development
Guard is a gem that helps you create a shared environment where all your team members have access to and can run tests, scripts, and other commands. If a command fails because someone else is already running it, Guard will ask that person to finish what they were doing before letting you run your commands. This ensures everyone is working with clean databases in their environments at all times.
RoR relies on a code style called Ruby Style Guidelines, which is enforced by the rubocop gem. Rubocop checks your project’s code against the official style guidelines and flags any deviations from those rules. I recommend using it in every RoR project to ensure that all of your code follows an uniform pattern.
An open source code coverage tool that helps identify which parts of your code are not being tested. SimpleCov measures the percentage of lines executed during a test run, as well as the average number of statements executed on each line.
With the number of great Ruby gems available, it can be tough to know what to use. Here are 10 of my favorites that will make you more productive and help you create better software.