Sometimes you need to add some special functions to your Ruby on Rails app, and you want these functions to be available everywhere in your application. In cases like these, you can put your code somewhere in Ruby on Rails's load path, and it will be loaded automatically without you having to "require" it in any of your other files.
Making OpenResty and Passenger work together isn't too hard, but it's not obvious how to do it. There's a lot of guides for getting Passenger to work with Nginx, but the process for OpenResty is a little different. For that reason, I'm documenting how I got them to work together here.
One year ago, I bought a washer and dryer from Best Buy. The technicians they sent to install the washer and dryer stripped out the threading inside the washer that's used to hold the shipping bolts. (Shipping bolts are used to stabilize the washer and prevent damage when it is moved.) I didn't realize this until one year later because I would have to uninstall and reinstall the washer myself in order to check that the shipping bolts were okay. Best Buy customer service lied to me to get me to hang up the first time I called. the second time I called, they refused to fix the problem in any way because I didn't realize the problem until after their 30 day warranty period expired.