Skip to content

Instantly share code, notes, and snippets.

@calebhaye
Created January 22, 2016 22:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Rails from Bash / Shell
#!/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