-
-
Save lnaia/d1399a626750b9a2eb39 to your computer and use it in GitHub Desktop.
Loading rails environment in a script placed anywhere
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
ROOT_PATH = File.expand_path File.dirname(__FILE__) | |
APP_PATH = "#{ROOT_PATH}/PATH_TO_YOUR_APP" | |
Dir.chdir APP_PATH | |
require File.join(File.dirname(__FILE__), *%w[config environment]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment