piggly trace- invalid multibyte escape

Background:

After installing piggly (see here for instructions) I had to remove the latest version of piggly due to this issue:

gem uninstall piggly

and I thus installed version 1.2.1

gem install piggly -v '1.2.1'

Problem:

After installing v 1.2.1 I attempted to run piggly trace:

piggly trace

And was confronted with the following error:

C:/Ruby/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require': C:/Ruby/Ruby21-x64/lib/ruby/gems/2.1.
0/gems/piggly-1.2.1/lib/piggly/compiler/cache.rb:23: invalid multibyte escape: /[\000-\010\016-\037\177-\300]/ (SyntaxError)
 from C:/Ruby/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require'
 from C:/Ruby/Ruby21-x64/lib/ruby/gems/2.1.0/gems/piggly-1.2.1/lib/piggly/compiler.rb:1:in `<top (required)>'
 from C:/Ruby/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require'
 from C:/Ruby/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require'
 from C:/Ruby/Ruby21-x64/lib/ruby/gems/2.1.0/gems/piggly-1.2.1/lib/piggly.rb:10:in `<top (required)>'
 from C:/Ruby/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
 from C:/Ruby/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
 from C:/Ruby/Ruby21-x64/lib/ruby/gems/2.1.0/gems/piggly-1.2.1/bin/piggly:5:in `<top (required)>'
 from C:/Ruby/Ruby21-x64/bin/piggly:23:in `load'
 from C:/Ruby/Ruby21-x64/bin/piggly:23:in `<main>'

The important bit here being:

compiler/cache.rb:23: invalid multibyte escape: /[\000-\010\016-\037\177-\300]/ (SyntaxError)

Fix:

In order to fix this I added the following line to the cache.rb file at “C:\Ruby\Ruby21-x64\lib\ruby\gems\2.1.0\gems\piggly-1.2.1\lib\piggly\compiler\cache.rb”:

# encoding: ASCII-8BIT

Note: This MUST be the first line in the file.

After adding this line and saving the file I re-ran piggly trace and it succeeded.

Resources:

Solution partially taken from here:

https://github.com/kputnam/piggly/issues/23

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s