Created
January 22, 2016 22:54
-
-
Save calebhaye/0c4af4db17f24193c2c2 to your computer and use it in GitHub Desktop.
Rails from Bash / Shell
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 | |
begin | |
puts "Loading Rails..." | |
require File.join('.', 'config', 'application') | |
require File.join('.', 'config', 'boot') | |
Rails.application.require_environment! | |
rescue | |
$stderr.puts "Please run #{$0} in your Rails root." | |
exit 1 | |
end | |
puts "Rails is ready." | |
puts "User.count: #{User.count}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment