Posted 8 months ago. Visible to the public.

Understanding IRB warning "can't alias ... from ..."

Sometimes, the IRB prints a warning during boot:

Copy
irb: warn: can't alias source from irb_source.

Explanation

During boot, the IRB creates many aliases to give the user quick access to irb functions like source-ing a file.

However, if IRB's context already responds to the alias it wants to create, it will not overwrite the method with its alias and print the above warning instead.

This may happen especially when invoking IRB programmatically, e.g. in Spreewald.

Solution

A workaround is to undef the method IRB complains about, prior to IRB initialization.

If this is not feasible, e.g. because you depend on the method, you can try to patch IRB, e.g. by modifying the EXTEND_COMMANDS or overriding this method.

Once an application no longer requires constant development, it needs periodic maintenance for stable and secure operation. makandra offers monthly maintenance contracts that let you focus on your business while we make sure the lights stay on.

Owner of this card:

Avatar
Dominik Schöler
Last edit:
8 months ago
by Dominik Schöler
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Dominik Schöler to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more