uninitialized constant Object::Jasmine

78 views
Skip to first unread message

Justin

unread,
Oct 18, 2011, 5:22:15 PM10/18/11
to Jasmine
Forgive the noob question but I'm trying to use Jasmine to test some
javascript that I'm using with a Goliath project. I installed jasmine
via bundler and then via gem install and in both cases when I try to
run 'jasmine' at the command line I get this:

/Users/jbasdf/.rvm/gems/ruby-1.9.2-p290@oerglue_proxy/gems/
jasmine-1.1.1/lib/jasmine.rb:4:in `<top (required)>': uninitialized
constant Object::Jasmine (NameError)
from /Users/jbasdf/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/
site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/jbasdf/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/
site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /Users/jbasdf/.rvm/gems/ruby-1.9.2-p290@oerglue_proxy/
gems/jasmine-1.1.1/bin/jasmine:4:in `<top (required)>'
from /Users/jbasdf/.rvm/gems/ruby-1.9.2-p290@oerglue_proxy/bin/
jasmine:19:in `load'
from /Users/jbasdf/.rvm/gems/ruby-1.9.2-p290@oerglue_proxy/bin/
jasmine:19:in `<main>'

Any idea what I'm doing wrong?

Thanks,
Justin

Rajan Agaskar

unread,
Oct 18, 2011, 5:32:50 PM10/18/11
to jasmi...@googlegroups.com
Hi Justin: 

This may be a problem with the latest Jasmine 1.1.1. Can you try specifying version 1.1.0 in your Gemfile? I'll try to take a look at this issue tonight. 

Thanks!

Rajan


--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To post to this group, send email to jasmi...@googlegroups.com.
To unsubscribe from this group, send email to jasmine-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jasmine-js?hl=en.


Justin Ball

unread,
Oct 18, 2011, 6:05:48 PM10/18/11
to jasmi...@googlegroups.com
I installed 1.1.0 and now I'm getting a different error (related to using a non Rails project I'm guessing):

This command:
bundle exec jasmine

Produces this output:
/Users/jbasdf/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rails (>= 3.0) amongst [addressable-2.2.6, archive-tar-minitar-0.5.2, rack-1.3.5, async-rack-0.5.1, bundler-1.0.21, ffi-1.0.9, childprocess-0.2.2, columnize-0.3.4, css_parser-1.2.5, dalli-1.1.2, diff-lcs-1.1.3, eventmachine-1.0.0.beta.4, em-socksify-0.1.0, http_parser.rb-0.5.3, em-http-request-1.0.0, em-synchrony-1.0.0, url_mount-0.2.1, http_router-0.9.7, log4r-1.1.9, multi_json-1.0.3, rack-contrib-1.1.0, rack-accept-media-types-0.9, rack-respond_to-0.9.8, goliath-0.9.3, jasmine-core-1.1.0, rspec-core-2.7.0, rspec-expectations-2.7.0, rspec-mocks-2.7.0, rspec-2.7.0, json_pure-1.6.1, rubyzip-0.9.4, selenium-webdriver-2.8.0, jasmine-1.1.0, kgio-2.6.0, ruby_core_source-0.1.5, linecache19-0.5.12, net-http-digest_auth-1.1.1, nokogiri-1.5.0, ruby-debug-base19-0.11.25, ruby-debug19-0.11.6, toadhopper-2.0, yajl-ruby-1.0.0] (Gem::LoadError)
        from /Users/jbasdf/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
        from /Users/jbasdf/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:434:in `find_by_name'
        from /Users/jbasdf/projects/oerglue_proxy/jasmine/ruby/1.9.1/gems/jasmine-1.1.0/lib/jasmine/base.rb:51:in `rails3?'
        from /Users/jbasdf/projects/oerglue_proxy/jasmine/ruby/1.9.1/gems/jasmine-1.1.0/lib/jasmine.rb:12:in `<top (required)>'
        from /Users/jbasdf/projects/oerglue_proxy/jasmine/ruby/1.9.1/gems/jasmine-1.1.0/bin/jasmine:4:in `require'
        from /Users/jbasdf/projects/oerglue_proxy/jasmine/ruby/1.9.1/gems/jasmine-1.1.0/bin/jasmine:4:in `<top (required)>'
        from /Users/jbasdf/projects/oerglue_proxy/jasmine/ruby/1.9.1/bin/jasmine:19:in `load'
        from /Users/jbasdf/projects/oerglue_proxy/jasmine/ruby/1.9.1/bin/jasmine:19:in `<main>'


Thanks for the help,
Justin

Danaka Kahn

unread,
Oct 18, 2011, 8:08:28 PM10/18/11
to jasmi...@googlegroups.com
On Tue, Oct 18, 2011 at 5:32 PM, Rajan Agaskar <ra...@pivotallabs.com> wrote:
Hi Justin: 

This may be a problem with the latest Jasmine 1.1.1. Can you try specifying version 1.1.0 in your Gemfile? I'll try to take a look at this issue tonight. 

Yes, at least for me yesterday when I ran bundle update, and moved from 1.1.0 to 1.1.1 of jasmine I had the same error. Reverting to 1.1.0 resolved, but I did not poke around to figure out why.
Message has been deleted

tom

unread,
Oct 19, 2011, 11:24:51 AM10/19/11
to Jasmine
Hi Justin,

I'm also a noob with both Jasmine and Ruby and was having the same
issue with v1.1.1 until I patched in the following to jasmine.rb:

https://github.com/pivotal/jasmine-gem/pull/63

'jasmine init' works fine for me now, hope that helps!

Tom

John Whitley

unread,
Oct 18, 2011, 6:02:42 PM10/18/11
to jasmi...@googlegroups.com
Rajan Agaskar wrote:
> This may be a problem with the latest Jasmine 1.1.1. Can you try specifying version 1.1.0 in your Gemfile? I'll try to take a look at this issue tonight.

The Jasmine gem v1.1.1 is broken in both Ruby 1.8.7 and 1.9.2. Reverting to 1.1.0 fixes the problem. FYI, there's already an open pull request (not mine) on this very issue on GitHub.

– John


Justin Ball

unread,
Oct 19, 2011, 12:40:08 PM10/19/11
to jasmi...@googlegroups.com
Thanks for the help. Any chance we'll see a 1.1.2 release with the patch sometime soon?

Thanks,
Justin

On Wed, Oct 19, 2011 at 9:38 AM, tom <ma...@thomashartnell.com> wrote:
Hi Justin,

I'm also a noob with both Jasmine and Ruby and was having the same issue until I patched in the following to jasmine.rb:


'jasmine init' works fine for me now, hope that helps!

Tom

--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jasmine-js/-/iRmN9vce4LIJ.

Rajan Agaskar

unread,
Oct 20, 2011, 10:54:00 AM10/20/11
to jasmi...@googlegroups.com
Well ... 

Here's what's going to happen: 

1. I'm rolling back the Rubygems/Rails detection fixes so people don't pull a broken Jasmine; if I can mark 1.1.1 as "don't pull" on Rubygems without yanking it, I'll do that, otherwise I'll push a 1.1.2 that just is a revert. I would've finished this yesterday, but I'm having to bump to HEAD of ci_reporter because there's some funny new fails about filename length with some of the XML it's writing out. 
2. I'll take another look at the patch that got merged to fix the Rubygems/Rails detect issues people were having. It snuck a load path into the gemspec (which seems a little weird to me) and I think this prevented our test suites from catching the issue. I really don't want to just roll forward with a manual require of the version.rb file until I do proper due diligence on the patch since we had breakage.
3. Re-merge the Rubygems fixes. 

Sorry for the breakage -- of course this would happen the one time I just rely on the test suites and don't manually check the jasmine-gem after a merge.

Thanks!

Rajan

Justin Ball

unread,
Oct 20, 2011, 11:38:32 AM10/20/11
to jasmi...@googlegroups.com
Thanks for the update Rajan and for all your work on a great gem!

Justin

Rajan Agaskar

unread,
Oct 27, 2011, 4:39:24 PM10/27/11
to jasmi...@googlegroups.com
So I pushed 1.1.2 this morning which is a revert and rewrite. The major change to the detection code is that instead of trying to figure out which RubyGems library we are using and including specific code for that library, we just try it every time. It's a little dumber, but more straightforward to understand (and means that the gemspec and main jasmine.rb lib stay simple). I think this should fix the require issues people have been seeing, but if you continue to have these problems please open an issue or just shout on the mailing list.

Thanks!

Rajan
Reply all
Reply to author
Forward
0 new messages