diff --git a/bin/rails b/bin/rails
index 0af1c3bafdf88d9b6cfbcf75403dae89b24fa5ef..5badb2fde0cb72bbb3cba8436721048dfd7e58dd 100755
--- a/bin/rails
+++ b/bin/rails
@@ -4,8 +4,6 @@ begin
 rescue LoadError => e
   raise unless e.message.include?('spring')
 end
-# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
-
-APP_PATH = File.expand_path('../../config/application',  __FILE__)
-require File.expand_path('../../config/boot',  __FILE__)
+APP_PATH = File.expand_path('../config/application', __dir__)
+require_relative '../config/boot'
 require 'rails/commands'