Posted:10/02/2014 3:29AM

Fixing the Gumby Framework Compass Watch Frozen Array Error

Mike Mclain discusses how to fix the Gumby framework compass watch (can't modify frozen array error) that occurs in sass/gumby.scss (sass/extensions/modular-scale/lib/modular-scale.rb:122: in delete_if

Preface:

A couple weeks ago I had the unfortunate pleasure of reinstalling my computer. Now, while I had the majority of the software I frequently use up and running in around three days flat; however, (since this time) I have come across a number of interesting problems that have occurred as a result of my reinstallation.

Conversely, (with this being said) today when i attempted to modify my Gumby Framework _custom.scss file and upon executing the compass watch command (in order to automatically detect changes and compile them into my gumby.css file) I was greeted with this lovely error message:

error sass/gumby.scss (..../Gumby-master/sass/extensions/modular-scale/lib/modular-scale.rb:122
:in delete_if': can't modify frozen Array)

Likewise, after spending around 30 minutes Googling this particular issue, I was able to loosely determined that this problem was occurring because my Ruby installation (mainly the Compass and SASS Gems) versions were newer than the version specified by my older copy of the Gumby Framework (version 2.6.3) modular-scale.rb file.

While I (admittedly) contemplated trying to implementing a ugly hack to overcome this issue; however, fortunately I discovered that the method of solving this problem was relatively straightforward.

Note: before attempting this procedure you should strongly consider the possibility of upgrading your version of the Gumby Framework to the newer source version (especially if you are working with a new installation) since it appears that the Gumby Framework transitioned from modular-scale 1.0.6 to modular-scale 2.0.6 (which will also resolve the frozen Array issue along with preventing other modular-scale issues from occurring); however, the method described below is predominantly for people who cannot upgrade their Gumby Framework to the newest version.

Fixing The Problem:

To begin, the first thing I had to do was determine what versions of Gems I had by typing the following command in the Windows console:

gem list --local

after which, the following Gems list was obtain:

*** LOCAL GEMS ***

bigdecimal (1.2.0)
chunky_png (1.3.1)
compass (1.0.1)
compass-core (1.0.1)
compass-import-once (1.0.5)
ffi (1.9.5 x64-mingw32)
io-console (0.4.2)
json (1.7.7)
minitest (4.3.2)
modular-scale (2.0.5)
multi_json (1.10.1)
psych (2.0.0)
rake (0.9.6)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
rdoc (4.0.0)
sass (3.4.5)
test-unit (2.0.0.0)

Noting that your list will likely vary depending upon your Ruby installation and OS.

Next, upon reviewing the Gumby Framework Compass requirements for the older version of the 2.6.3 framework via Googling (your results may vary depending upon your version of the Gumby Framework), I was able to determine that Compass 0.12.7 and SASS 3.2.19 was required.

Likewise, because the Gems versions I had was newer than the Gems versions required by the Gumby Framework (and given my overall lack of knowledge surrounding concurrent version usage), I decided to remove my current version of Compass and SASS by typing the following commands (noting that the current component version of each Gems was obtained from the Gems list obtained above):

gem uninstall compass -v 1.0.1
gem uninstall sass -v 3.4.5

Noting that I also uninstalled compass-core and compass-import-once via typing:

gem uninstall compass-core -v 1.0.1
gem uninstall compass-import-once -v 1.0.5

for good measure; however, I do not believe this was necessary.

Additionally, you should also review your Gumby Framework config.rb file since (if you actually read the framework documentation --- yes, who has time for that --- and selected the Ruby installed version of modular-scale over the copy provided locally by the Gumby Framework) you will also need to uninstall modular-scale by typing:

gem uninstall modular-scale -v 2.0.5

Conversely, once the newer Gems are removed, you can installed the older Gem versions by typing:

gem install compass --version 0.12.7
gem install sass --version 3.2.19

Noting that if you uninstalled modular-scale you will also need to type:

gem install modular-scale --version 1.0.6

Likewise, upon running the compass watch or the compass compile command again, you should now be able to recompile the Gumby Framework source into a gumby.css` file.

Conclusion:

While I am sure that the versions I specified in the commands above will not always resolve every instance of this particular error (my apologies to the non Gumby Framework version 2.6.3 users ); however, once you are able to determine the required Compass / SASS versions the methodology provided above should hopefully remain very applicable.

Enjoy!