cjohansen / juicer

A command line tool for JavaScript and CSS developers
630 stars 47 forks source link

rake test task fails (rubygems not loaded) [patch] #15

Closed ktheory closed 14 years ago

ktheory commented 14 years ago

When I run "rake test" with the latest master, I get an error:

./test/test_helper.rb:3:in `require': no such file to load -- shoulda (LoadError)

If I add

require 'rubygems'

to test_helper.rb, the tests run fine. See http://github.com/ktheory/juicer/commit/dddb5213f380a45f6b5152ac8df4ddc15da06253 for my trivial patch

I'm running a pretty standard OS X Snow Leopard system, with the bundled ruby 1.8.7 and an updated rake 0.8.7.

gem list rake ... rake (0.8.7, 0.8.3)

Rake TestTasks shell out to another ruby process for running tests, which is why loading rubygems in the Rakefile doesn't apply.

I'm curious how you run the tests in your dev environment. What version of rake are you using? Do you use "rake test" to run the tests, or another command?

-Aaron

cjohansen commented 14 years ago

I run the tests with rake test. To fix the problem you're encountering, I have this in my .zshrc file:

export RUBYOPT=-rubygems

ktheory commented 14 years ago

Works like a charm. Thanks!

-Aaron

cjohansen commented 14 years ago

Closing ticket