.Irbrc file not loaded by rails console

Is there a way to get a “rail console” to load .irbrc? Or should I use something else?

+7
ruby-on-rails
source share
2 answers

rails console by default loads ~/.irbrc , so I don't understand your question. However, it will fail (and not load it) if there are some errors in this file.

One example of such an error is the requirement that no gems be found in the Gemfile (for Rails3 + Bundler), and not a rescue from LoadErrors (or expected to just work).

+12
source share

rails c does not load other .irbrc , but from the current home user ( ~ ).

See https://gist.github.com/railsbros-dirk/719848

You can configure your application.rb rails to load the root .irbrc file, if any.

0
source share

All Articles