Export to GitHub

blueprintcss - issue #87

compress.rb errors on mac osx


Posted on Feb 20, 2008 by Massive Horse

I installed blueprint 0.7 in my ~/Sites folder. I cd in Terminal to the /lib directory and try 'ruby compress.rb' without quotes.

I get the following error…

/Users/test/Sites/blueprint\ 0.7/lib/blueprint/../../lib/blueprint/grid_builder.rb:5: uninitialized constant Gem (NameError) from ./blueprint/blueprint.rb:26:in require' from ./blueprint/blueprint.rb:26 from ./blueprint/blueprint.rb:25:ineach' from ./blueprint/blueprint.rb:25 from compress.rb:2:in `require' from compress.rb:2

Not sure what the error is, as I don't use ruby just PHP/mysql, html/css. I'm on Mac OSX 10.4.11 with developer tools installed.

I was simply trying to alter the grid width and number of columns.

Can I simply copy my new grid .css into the screen.css or does the compress.rb do more than that? Do I need any other frameworks to run ruby?

Comment #1

Posted on Feb 20, 2008 by Happy Horse

The file you're referring to generates a new grid.png file if you alter the default layout. Seems you don't have the required ruby gems (plugins) for this to work.

It's supposed to just skip this step if you don't have them, so this is most likely a bug. This is Josh's field though, so he'll probably have a better answer. :)

For now, it should be enough to delete the following lines from lib/blueprint/compressor.rb:

attempt to generate a grid.png file

if (grid_builder = GridBuilder.new(:column_width => self.custom_layout.column_width, :gutter_width => self.custom_layout.gutter_width, :output_path => File.join(self.destination_path, 'src'))) grid_builder.generate! end

Comment #2

Posted on Feb 20, 2008 by Massive Horse

Thanks,

I deleted the lines mentioned above, but I still get the following output…

/Users/test/Sites/bluey/lib/blueprint/../../lib/blueprint/grid_builder.rb:5: uninitialized constant Gem (NameError) from ./blueprint/blueprint.rb:26:in require' from ./blueprint/blueprint.rb:26 from ./blueprint/blueprint.rb:25:ineach' from ./blueprint/blueprint.rb:25 from compress.rb:2:in `require' from compress.rb:2

This is from a clean version of blueprint.

As it happens, I don't need to update the grid.png, since I am keeping the same grid format, I just want less columns and less width.

Drew

Comment #3

Posted on Feb 20, 2008 by Happy Horse

Ah, you might be missing RubyGems itself. Don't worry, Josh will be along shortly.

Thanks for reporting this bug, might be quite a serious one. :)

Comment #4

Posted on Feb 20, 2008 by Massive Horse

This is my first day trying Blueprint, so I may easily have missed something obvious.

FWIW I get… ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] for 'ruby --version' This is the default Apple version of Ruby, I suspect I need to upgrade it to something newer, Googling already :)

No idea how to check what Gems are installed?

Drew

Comment #5

Posted on Feb 20, 2008 by Happy Horse

Try running: $ gem -v, to see if you have Rubygems installed, and if you have, it will show you which version.

If it's not installed, you can try installing it and see if this solves the problem: http://docs.rubygems.org/

However, note that Rubygems is not required to use the compressor, it's just needed for this one feature to work, as it deals with generating new PNG files.

If you don't want to install Rubygems, just hang on a second until we can fix this.

Of course, it could be that the bug has to do with something else. Expect an update on this tonight. :)

Comment #6

Posted on Feb 21, 2008 by Massive Horse

This may not be a bug?

I installed Ruby (1.8.6) from instructions here http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx/ . I also installed ruby gems (1.0.1).

Now when I run 'ruby compress.rb' I get the 'Blueprint CSS Compressor' output. The CSS files are also generated.

I was previously on version 1.8.2 (Apple default install) of ruby without gems, incase that helps.

PS The link for Mac OSX Ruby setup could be added to the Blueprint Wiki Links, since generating the CSS files requires a version of Ruby that works (the default Ruby doesn't seem to).

Thanks, Drew

Comment #7

Posted on Feb 21, 2008 by Happy Horse

This issue is fixed in BP 0.7.1, released just now.

Again, the compressor does not require Rubygems, but you'll get a newly generated grid.png if you have it and a few other gems installed. :)

Status: Fixed

Labels:
Type-Defect Priority-Medium