Created
March 23, 2020 15:28
-
-
Save harshalbhakta/344c4eb34a6f391a31628dc9978953d8 to your computer and use it in GitHub Desktop.
macOS Catalina 10.15.3 /usr/bin/rails
This file contains hidden or 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/ruby | |
| # Stub rails command to load rails from Gems or print an error if not installed. | |
| require 'rubygems' | |
| version = ">= 0" | |
| if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then | |
| version = $1 | |
| ARGV.shift | |
| end | |
| begin | |
| gem 'railties', version or raise | |
| rescue Exception | |
| puts 'Rails is not currently installed on this system. To get the latest version, simply type:' | |
| puts | |
| puts ' $ sudo gem install rails' | |
| puts | |
| puts 'You can then rerun your "rails" command.' | |
| exit 0 | |
| end | |
| load Gem.bin_path('railties', 'rails', version) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment