8 Apr 2013 6:16 AM #1
Problem with Compass
Problem with Compass
I'm trying to use the latest build of Sencha Cmd, 126.96.36.1996, and when I try to build my app it fails when it gets to the -sass section. I get the following error:
.../rubygems/dependency.rb:247:in `to_specs': Could not find compass (>= 0) amongst  (Gem::LoadError) from .../rubygems/dependency.rb:256:in `to_s pec' from .../rubygems.rb:1231:in `gem' from .../Sencha/Cmd/188.8.131.526/extensions/sencha-compass/gems/bin/compass:22:in `<main>' .../.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find compass (>= 0) amongst  (Gem::LoadError) from .../.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_s pec' from.../.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem' from .../Sencha/Cmd/184.108.40.2066/extensions/sencha-compass/gems/bin/compass:22:in `<main>'
I'm running Ruby 1.9.3-p194 under Windows 7/Cygwin. Any ideas on things to look for/change would be greatly appreciated.
I do have one other question. If I run 'sencha compass' it never seems to do anything other than to write out the list of options. It never acts like it does any work. It doesn't complain, or say anything, it just lists the options. What is it supposed to be doing?
9 Apr 2013 6:46 AM #2
9 Apr 2013 10:00 AM #3
I still have no solution, but I do have more information. The problem I'm having seems to stem from when Sencha Cmd executes a 'set GEM_HOME = C:\<path to sencha cmd>\extensions\sencha-compass\gems'. I tried executing this command in a shell and then ran irb. While in irb, I executed:
which returned an empty array. I then executed:
Gem::Specification.dirs and got back an array something like this:
I found it very odd that the slashes were doubled. For kicks, I set my GEM_HOME to the same path, but using my cygwin path:
set GEM_HOME =\cygdrive\c\path\to\senchacmd\extensions\sencha-compass\gems
and redid my test in irb. This time I saw the list of gems which I would expect to find from the sencha-compass collection.
To verify that running the real Sencha Cmd would produce the same results, I modified my Gem::Specification file to output the directories it was searching when it tried to find the gem. I then ran sencha --debug compass compile and watched the results. During the run it set the GEM_HOME to c:\path\to\senchacmd\..., it failed trying to locate the gems in Gem::Specification.all_names and the directories it was searching had the funny double slash in the search path.
I'm going to consult with another Ruby guy here at work to see if he can help me figure out why this may be happening, but I thought I would add this information to my original post in case someone else has any ideas.
The key things about my environment are that I'm running Windows 7 and cygwin. I have ruby installed via rvm under cygwin. My Windows environment is configured to reference the ruby and gems that were installed by rvm. My command line ruby works fine in both a regular Windows terminal shell as well as the cygwin shell. The only problem I'm having involves Sencha Cmd.
Thanks in advance for any help.
16 Apr 2013 6:02 AM #4
After much pain I have at least found a working solution. I typically run in a Cygwin environment and my Windows box was configured to use a ruby installed by rvm. This ruby is a cygwin ruby (i386-cygwin). No matter what I did, I could not get Sencha Cmd to run compass (sencha compass compile). Whenever I ran this command I was told that the compass gem was not found. I finally decided to install a native Windows version of ruby (i386-mingw32). Running with this version of Ruby, I was finally able to get the Sencha version of Compass to run. It seems, and this is just a guess, that the Cygwin version of ruby doesn't like it when the GEM_HOME is set to something like
which is what Sencha Cmd does when it runs compass. When running the cygwin ruby, if I manually set the GEM_HOME to the way Sencha Cmd sets it, I would get the error telling me that compass wasn't found in the available gems. However, if I set the GEM_HOME to
it worked just fine.
I'm wondering if the Cygwin Ruby doesn't entirely like the windows path strings. It's also possible that I have some other configuration issue which is causing the problem.
The upshot for me, at least, was that I could only get Sencha Cmd to work on Windows if I run the mingw32 version and not the cygwin version.
26 Apr 2013 12:29 PM #5
Thanks for your persistence in figuring this out, you just saved me a load of time. I've installed ruby 1.9.3 using rubyinstaller, and now cmd is working properly for me.
However, I cannot get it to work from within a Cygwin shell. Rather, I have to open a DOS command window to run it. That works but is pretty painful. Looks like a problem with DOS-style paths. I get this error when I try to run GEM:C:\Ruby193\bin\ruby.exe: No such file or directory -- /cygdrive/c/Ruby193/bin/gem (LoadError)Any thoughts?
26 Apr 2013 12:44 PM #6
26 Apr 2013 12:55 PM #7
OK, will post back here if I figure anything out.
26 Apr 2013 1:50 PM #8
This is weird. I can now run Sencha command from Cygwin shell, but I don't know what I did to make it work. Perhaps it always worked, but I was fooled because *gems* won't run from Cygwin.
Actually, I've figured out how to run gems from Cygwin. Instead of
But again, sencha command itself seems to be working OK for me, and that clearly includes parts where it is calling Compass (I'm building themes right now). There are many aspects to this mess that I don't really understand, but most of it boils down to trying to use UNIX-style tools on Windows. It's all very fragile.
28 May 2013 4:19 PM #9
My coworker and I encountered this same problem while running Sencha Cmd v220.127.116.112 under Cygwin, using Cygwin's Ruby v1.9.3p392.
Since we prefer Cygwin/bash over cmd.exe, I came up with the following workaround, which allows Sencha Cmd to be used from a Cygwin bash prompt, without getting an error due to the compass gem not being found.
The key turns out to be that while Cmd uses the system-installed (Cygwin) Ruby, it installs and uses its own version of the compass command and gem, regardless of whether or not the compass command and gem exist in the Cygwin environment - many thanks to earlier posters for point this out.
The workaround involves editing one of Sencha Cmd’s files - its compass command - so unless Sencha chooses to address this issue in a future version of Cmd, you'll need to re-apply the workaround in any new version of Cmd that you upgrade to. It should be safe to use and easy to re-apply, though, as all we do is detect when we're running compass under Cygwin, and translate the GEM_PATH environment variable from DOS style to Cygwin/Unix style.
To apply the workaround, open your C:\Users\your_name\bin\Sencha\Cmd\18.104.22.1682\extensions\sencha-compass\gems\bin\compass file (or local equivalent, if you installed Cmd somewhere other than the default) in a text editor. Below the comment block at the top, add this Ruby code:
if ENV['PATH'].include? "cygdrive" if ENV['GEM_PATH'].index(':') == 1 drive = ENV['GEM_PATH'] path = ENV['GEM_PATH'][2..-1] ENV['GEM_PATH'] = "/cygdrive/" + drive.downcase + path.gsub('\\', '/') end end
There may be a more elegant way of going about this, but Ruby is not my primary language. :)
Note that Cygwin may still generate warning output about having detected a DOS style path, but it doesn't impede Sencha Cmd's build process. If you want to suppress those warnings, you can set the CYGWIN environment variable to "nodosfilewarning" (no quotes); note that you need to do this in Windows' environment variable settings, not in your .bash_profile.
Anyway, I hope this helps somebody out there use Sencha Cmd under Cygwin. :)