0

I'm having a problem using unroller. I have installed the gem and wrote this simple program to help focus on the problem i'm having:

#!/usr/bin/ruby

require 'rubygems'
require 'unroller'

Unroller::trace

def foo(p1, p2)
  puts p1
  puts p2
end

foo("param1", "param2")

Running the program yields:

/Library/Ruby/Gems/1.8/gems/facets-2.9.3/lib/core/facets/filetest/separator_pattern.rb:5: warning: already initialized constant SEPARATOR_PATTERN
/Library/Ruby/Gems/1.8/gems/facets-2.9.3/lib/core/facets/string/bracket.rb:3: warning: already initialized constant BRA2KET
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- facets/methodspace (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
from /Library/Ruby/Gems/1.8/gems/unroller-1.0.0/lib/unroller.rb:4
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:60:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:60:in `require'
from ./ut:4

My ruby version is ruby 1.8.7 (2011-12-28 patchlevel 357). I also installed ruby on my Windows development box and get the same error and that ruby version is 1.9.3 so it does not appear to be related to the version of Ruby I'm on.

Anyone have any ideas?

Thanks very much in advance!

jon

1
  • Have yo looked at the known errors for unroller? Has anyone reported it?
    – Linuxios
    Jul 9, 2012 at 0:24

1 Answer 1

0

This is a bug of unroller gem, described here: https://github.com/TylerRick/unroller/issues/1. unroller automatically requires the latest version of facets gem and the version 2.9 breaks it. (BTW gems should never use '>=' when loading dependencies, that's why '~>' is for.)

It's not that difficult to hotfix locally by using bundler and hardcoding facets gem to specific version before requiring unroller (so the specific facets version gets loaded instead of latest 2.9).

create Gemfile:

source 'http://rubygems.org'

gem 'facets', '2.8.4' 
gem 'termios' # you're gonna need this gem too, for some reason
gem 'unroller'

run bundle install and then either run the script by bundle exec ruby test.rb or require bundler/setup in it:

require 'rubygems'
require 'bundler/setup'
require 'unroller'
...

UPDATE: or if you don't wanna deal with bundler, try this first, it could work too:

require 'rubygems'
gem 'facets', '2.8.4'
require 'unroller'
...
5
  • I tried: require 'rubygems' gem 'facets', '2.8.4' require 'unroller' But that didn't work either. Instead I uninstalled facets-2.9.3 and then installed facets-2.8.4. That lead to: /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require': no such file to load -- termios (LoadError) So I installed termios and that worked. I searched high and low for some help on this before posting here and never found github.com/TylerRick/unroller/issues/1. Thanks very much for the help! Jul 9, 2012 at 15:26
  • Yeah, I linked to that issue ticket in my answer :). It's better to use bundler then. Jul 9, 2012 at 15:56
  • 1
    Seems like an easy fix for the author of unroller. Begs the question, why hasn't this been fixed? Jul 9, 2012 at 16:08
  • My thoughts exactly. Especially since the last working version of facets is really old. rubygems.org/gems/facets/versions Jul 9, 2012 at 16:42
  • Maybe we can fix it? I posted that to github.com/TylerRick/unroller/issues/1. Jul 9, 2012 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.