Sometimes it’s useful to run a Rails app in production mode locally for testing purposes. This may not always be feasible depending upon the complexity of the project, but when it is, the following steps can be followed.
Here’s how to retrieve information about application tables in Rails, demonstrated from the Rails console (
vim does not have a method to count word frequency by default, but it is easily added in a function.
When running scripts against Postgres with the
psqlclient, errors will accumulate by default. This is good from the perspective of resiliency, but may not always be desirable behavior, especially with a long-running script.
Sometimes it is necessary to override inbuilt functionality of Rails (or other dependencies) by creating a monkey patch. However this may only be intended as a temporary solution, waiting on some future fix or upgrade to the framework.