requiring mocha >= 1.2.9?

14 views
Skip to first unread message

Bess Sadler

unread,
Aug 5, 2010, 10:02:42 AM8/5/10
to active...@googlegroups.com
Hey, folks. Is it true that active_fedora requires mocha >= 1.2.9?

Running rake check_dependencies on master gives me

Missing some dependencies. Install them with the following commands:
gem install mocha --version ">= 1.2.9"

But I can't find a mocha release later than 0.9.8: http://rubygems.org/gems/mocha
Nor any mocha derivative projects: http://rubygems.org/search?query=mocha

Am I missing something? This is either an error in what is required or else we should provide some additional documentation for how to get this gem.

Thanks!
Bess

Bess Sadler

unread,
Aug 5, 2010, 10:51:41 AM8/5/10
to ActiveFedora / Ruby + Fedora Commons
I changed the requirement to mocha 0.9.8, re-installed the gem, and
now I get a different error. I feel like I've seen this before and it
was a syntax problem from different versions of ruby, but I'm having
trouble tracking it down. Any pointers?

Thanks!
Bess

[root@sdr-fedora-dev bess_active_fedora (master)]# rake -T --trace
(in /usr/local/src/bess_active_fedora)
I, [2010-08-05T07:32:16.309732 #16673] INFO -- : FEDORA: loading
SolrService mappings from /usr/local/src/bess_active_fedora/config/
solr_mappings.yml
rake aborted!
/usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets/objectspace/
reflect.rb:34: syntax error
Functor.new do |meth, *a, &b|
^
/usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets/objectspace/
reflect.rb:39: syntax error
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'

Bess Sadler

unread,
Aug 5, 2010, 11:14:16 AM8/5/10
to active...@googlegroups.com
Sorry, I just re-read this and realized I was being vague. To clarify, I forked ActiveFedora, and locally I'm calling that fork bess_active_fedora in order to distinguish. On my laptop when I change the requirement to be for mocha 0.9.8 it fixes the problem, but on the server it just changes the error and I cannot install my edited copy of the gem because of the error pasted below.

Is the answer to this problem "Start using RVM"?

It seems to be some problem with om (opinionated metadata). I'm using om 0.1.10 in both cases. I can re-create the bug like this:

[root@sdr-fedora-dev bess]# irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'om'
SyntaxError: /usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets/objectspace/reflect.rb:34: syntax error


Functor.new do |meth, *a, &b|
^
/usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets/objectspace/reflect.rb:39: syntax error

from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets/objectspace.rb:4
from /usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets/objectspace.rb:3:in `each'
from /usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets/objectspace.rb:3
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets.rb:4
from /usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets.rb:2:in `each'
from /usr/lib/ruby/gems/1.8/gems/facets-2.8.4/lib/core/facets.rb:2
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/lib/ruby/gems/1.8/gems/om-0.1.10/lib/om.rb:4
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from (irb):2

On my local laptop the same commands work fine:

anon-36-189:hydrangea bess$ irb
ruby-1.8.7-p174 > require 'rubygems'
=> true
ruby-1.8.7-p174 > require 'om'
=> true


Bess

> --
> You received this message because you are subscribed to the Google Groups "ActiveFedora / Ruby + Fedora Commons" group.
> To post to this group, send email to active...@googlegroups.com.
> To unsubscribe from this group, send email to active-fedor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/active-fedora?hl=en.
>

Matthew Zumwalt

unread,
Aug 5, 2010, 11:19:18 AM8/5/10
to active...@googlegroups.com
You're right that there is not a version 1.2.9.  I've got 0.9.8 installed on my computer.  It seems that version number for rspec drifted down to the mocha dependency line!

I've fixed that in my copy and rake spec still runs fine.

Matt Zumwalt
MediaShelf, LLC




Matthew Zumwalt

unread,
Aug 5, 2010, 11:21:52 AM8/5/10
to active...@googlegroups.com
What version of Ruby do you have on the server?

I've never seen that error before.  It's occurring within the facets gem which, to be honest, I can't remember what we use it for.  I will look into that.  Maybe I can remove that dependency from om.


Matt Zumwalt
MediaShelf, LLC




Bess Sadler

unread,
Aug 5, 2010, 11:30:39 AM8/5/10
to active...@googlegroups.com
In both cases it's ruby 1.8.7, but different patch levels.

On the server:

[bess@sdr-fedora-dev bess_active_fedora]$ which ruby
/opt/ruby-enterprise-1.8.7-2010.01/bin/ruby
[bess@sdr-fedora-dev bess_active_fedora]$ ruby -v
ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01


On my laptop:

anon-36-189:hydrangea bess$ which ruby
/Users/bess/.rvm/rubies/ruby-1.8.7-p174/bin/ruby
anon-36-189:hydrangea bess$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.4.0]

Matthew Zumwalt

unread,
Aug 5, 2010, 11:31:47 AM8/5/10
to active...@googlegroups.com
Ah yes .. facets provides the deep_copy method for cloning nested hashes.  We'll be removing the need for deep_copy in the next release of om as part of a pressing ticket for Hydrangea, so the dependency will go away soon.

In the meantime, for the sake of sanity, you might want to put rvm on the server and check if running on a different ruby version fixes the problem.

Otherwise, if it's not a Ruby version thing, possibly you could contact the facets developers.  They have an active mailing list.

Matt Zumwalt
MediaShelf, LLC




On Aug 5, 2010, at 10:14 AM, Bess Sadler wrote:

Chris Fitzpatrick

unread,
Aug 5, 2010, 12:43:43 PM8/5/10
to active...@googlegroups.com

FYI - I also ran into this issue yesterday with the facets gem.

It seems OM installed facets (it's dependency is marked as > 0). The
newest version of facets (2.8.4) does not seem to work with Ruby 1.8.6
(which some of our servers are still running). Although facets
documentation says it's compatible with 1.8.6, that does not seem to be
the case.

I've tested this out on my laptop using rvm versions of ruby 1.8.6 and
1.8.7 .

I installed facets 2.7.0 and everything seems to work fine.

best,chris.

>>> <mailto:active...@googlegroups.com>.


>>> To unsubscribe from this group, send email to
>>> active-fedor...@googlegroups.com

>>> <mailto:active-fedor...@googlegroups.com>.


>>> For more options, visit this group at
>>> http://groups.google.com/group/active-fedora?hl=en.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "ActiveFedora / Ruby + Fedora Commons" group.
>> To post to this group, send email to active...@googlegroups.com

>> <mailto:active...@googlegroups.com>.


>> To unsubscribe from this group, send email to
>> active-fedor...@googlegroups.com

>> <mailto:active-fedor...@googlegroups.com>.

Bess Sadler

unread,
Aug 5, 2010, 1:18:10 PM8/5/10
to active...@googlegroups.com
Chris, you rock. That fixed my problem.

Matt, can we get the requirement for om changed so it requires facets 2.7.0 specifically?

Thanks!

Bess

Chris Fitzpatrick

unread,
Aug 5, 2010, 4:08:18 PM8/5/10
to active...@googlegroups.com

Hey everyone,

Looks like I might have spoken too soon....I ran rake spec in the om gem
directory and am getting a number of failures when using ruby 1.8.6
(with facets 2.7.0 installed)
However, when I switch to 1.8.7 (with facets 2.8.4), it looks like all
the tasks pass.
The tests for Active Fedora 1.1.13 look like they pass for both ruby
1.8.6 and 1.8.7.

So, I'd say the fix is to use ruby 1.8.7 if you're using the om gem.

Apologize about the confusion .


best,chris.

Chris F.

unread,
Aug 5, 2010, 11:19:14 PM8/5/10
to ActiveFedora / Ruby + Fedora Commons

More FYI - I've run into another issue with the facets gem.
http://github.com/rubyworks/facets/blob/master/lib/core/facets/time/future.rb

If you notice, #past? and #future? are identical, which I think is a
type. This is a problem since it overrides DateTime.future? and
returns the exact oppositie of the expected result.
In the application, I replaced future? with " > DateTime.current" to
steer clear of this issue.


best,chris.
> >>>>> For more options, visit this group athttp://groups.google.com/group/active-fedora?hl=en.
>
> >>>> --
> >>>> You received this message because you are subscribed to the Google Groups "ActiveFedora / Ruby + Fedora Commons" group.
> >>>> To post to this group, send email to active...@googlegroups.com <mailto:active...@googlegroups.com>.
> >>>> To unsubscribe from this group, send email to active-fedor...@googlegroups.com <mailto:active-fedor...@googlegroups.com>.
> >>>> For more options, visit this group athttp://groups.google.com/group/active-fedora?hl=en.
>
> >>> --
> >>> You received this message because you are subscribed to the Google Groups "ActiveFedora / Ruby + Fedora Commons" group.
> >>> To post to this group, send email to active...@googlegroups.com.
> >>> To unsubscribe from this group, send email to active-fedor...@googlegroups.com.
> >>> For more options, visit this group athttp://groups.google.com/group/active-fedora?hl=en.
Reply all
Reply to author
Forward
0 new messages