summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2010-05-11 11:16:49 -0700
committerDaniel DeLeo <dan@opscode.com>2010-05-11 11:16:49 -0700
commit9279ab1248dec6ab7cf2e636ee21b5b3828924f8 (patch)
tree47ce269f7686385f18e400a4b9c8fdeee6aae375 /bin
parent46c6d99a0a6e9b148cd827da9d38d0f55e76bfa3 (diff)
downloadohai-9279ab1248dec6ab7cf2e636ee21b5b3828924f8.tar.gz
fix load path rejiggering to be less janky and also work
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ohai5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/ohai b/bin/ohai
index 5c9004a6..cb900e39 100755
--- a/bin/ohai
+++ b/bin/ohai
@@ -19,9 +19,7 @@
# limitations under the License.
#
-require 'rubygems'
-$: << File.join(File.dirname(__FILE__), "..", "lib")
begin
require 'rubygems'
rescue LoadError
@@ -29,6 +27,9 @@ rescue LoadError
missing_rubygems = true
end
begin
+ # if we're in a source code checkout, we want to run the code from that.
+ # have to do this *after* rubygems is loaded.
+ $:.unshift(File.expand_path(File.dirname(__FILE__) + '/../lib'))
require 'ohai/application'
rescue LoadError
if missing_rubygems