Gems

They already solved it AND wrote it? Well how much is that going to cost me? It’s free!?! Well heck yeah, sign me up!
There are times to use gems, and there times not to use gems. In either case, you will want to be educated when making these decisions. What have you learned when using a particular gem? What are those little steps that were not spelled out, or that were unique to your app, that you needed to do in order to get the gem to work properly for you? You will want to remember these little additions and subtractions for your next project.

Require and load a gem in IRB for testing purposes while developing the gem

01/20/18  Public, Ruby General, Gems

  • cd into the root of the gem
  • run bin/console

Done.

Or,

  • cd into the root of the gem
  • run bundle console

Or,

  • cd into the root of the gem
  • run irb -I lib
  • run require "name_of_gem"

For example:

$ i...

1 vote - harrylevine

Gem to help with Rails Errors

05/10/15  Public, Rails Errors, Gems

When dealing with a particularly complex bug, logging and raising errors can become tedious or imprecise. The better_errors gem is there to help. The gem transforms your in-browser error page, add...

0 votes - harrylevine

After log in should redirect to a page other than default root

11/16/14  Public, Rails General, Gems

When using Devise, when a registered user logs in, they are, by default, directed to the root.

Here is the code to change this to being directed to a page of your choosing

In `app/controllers/appl...

1 vote - harrylevine

Determine what gems in your project have newer versions available

11/08/14  Public, Rails General, Gems

Run bundle outdated

To help decide if you want to take action and update a particular gem, view the gem's changelog.

For example, if there is an updated version of Devise available, Google devise changelog to determine what has been ch...

1 vote - harrylevine

Updating Rails version for a patch update, i.e. from 4.1.1 to 4.1.7

11/07/14  Public, Command Line, Rails General, Gems

  • Create a new branch
  • update the gemfile to gem 'rails', '4.1.7'
  • run bundle
  • this may show conflicts in other rails dependencies like
    • actionview, actionpack, actionmodel, etc
  • in order to update these Rails associated items, and...

1 vote - harrylevine