Q:

homebrew can't run my own formula

I just follow the instruction to create my "own" homebrew formula from github, following this tutorial 
http://formalfriday.club/2015/01/05/creating-your-own-homebrew-tap-and-formula.html,
actually I just want to install mongodb older version, so I check the homebrew mongodb source code(because I like everything using homebrew, lazy guy uhuh...):
https://github.com/Homebrew/homebrew/blob/master/Library/Formula/mongodb.rb

I just want to change the Line 6:
 url "https://fastdl.mongodb.org/src/mongodb-src-r3.0.1.tar.gz"

into:
 url "https://fastdl.mongodb.org/src/mongodb-src-r3.0.0.tar.gz"

Nothing more, just version number, so I copy all the source cold, and create my own formula, but when I run the brew command, I got many errors including:
/usr/local/bin/mongold: line 2: require: command not found
/usr/local/bin/mongold: line 3: require: command not found
/usr/local/bin/mongold: line 5: Formula: No such file or directory
/usr/local/bin/mongold: line 6: homepage: command not found
/usr/local/bin/mongold: line 7: url: command not found
/usr/local/bin/mongold: line 8: sha256: command not found
/usr/local/bin/mongold: line 12: depends_on: command not found
/usr/local/bin/mongold: line 13: go_resource: command not found
/usr/local/bin/mongold: line 14: url: command not found
/usr/local/bin/mongold: line 15: :tag: command not found
/usr/local/bin/mongold: line 16: :revision: command not found
/usr/local/bin/mongold: line 17: end: command not found
/usr/local/bin/mongold: line 19: bottle: command not found
/usr/local/bin/mongold: line 20: sha256: command not found
/usr/local/bin/mongold: line 21: sha256: command not found
/usr/local/bin/mongold: line 22: sha256: command not found
/usr/local/bin/mongold: line 23: end: command not found
/usr/local/bin/mongold: line 25: option: command not found
/usr/local/bin/mongold: line 27: depends_on: command not found
/usr/local/bin/mongold: line 28: depends_on: command not found
/usr/local/bin/mongold: line 29: depends_on: command not found
/usr/local/bin/mongold: line 30: depends_on: command not found
/usr/local/bin/mongold: line 32: def: command not found
/usr/local/bin/mongold: line 36: Language::Go.stage_deps: command not found
/usr/local/bin/mongold: line 38: cd: src/github.com/mongodb/mongo-tools: No such file or directory
/usr/local/bin/mongold: line 39: args: command not found
/usr/local/bin/mongold: line 134: syntax error: unexpected end of file

Am I doing something wrong? I am fairly new to ruby and brew , thanks 

A:

Install it with brew install ./mongo_old.rb (the leading ./ is special); formulas are Ruby code and are not executable directly.

