Giter Club home page Giter Club logo

Comments (12)

badsyntax avatar badsyntax commented on July 24, 2024

I have not tested in Windows 8, so I can't guarantee it will work in that environment.

Can you confirm the following:

  • Are there any errors in the python console (View > Show Console) in Sublime Text when running the plugin?
  • Have you installed sass?
  • Has sass been added to your environment path? (EG, can you run sass-convert --version from cmd.exe?)

from sassbeautify.

WilliamVercken avatar WilliamVercken commented on July 24, 2024
  • Sass is installed
  • When I do sass-convert --version in the Command Prompt (with Ruby), it shows me : Sass 3.2.12 (Media Mark)
  • You're right, there are errors when I execute SassBeautify !

Here is the copy/paste :

Exception in thread Thread-3:
Traceback (most recent call last):
  File ".\threading.py", line 532, in __bootstrap_inner
  File ".\SassBeautify.py", line 51, in run
  File ".\subprocess.py", line 701, in communicate
  File ".\subprocess.py", line 911, in _communicate
IOError: [Errno 32] Broken pipe
Traceback (most recent call last):
  File ".\SassBeautify.py", line 134, in 
  File ".\SassBeautify.py", line 137, in check_thread
  File ".\SassBeautify.py", line 154, in handle_process
AttributeError: 'NoneType' object has no attribute 'splitlines'

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

OK then, thanks for this. I'm a total python noob, but i've done a bit of research and I'm taking an educated guess that the issue is SIGPIPE, and this is a possible solution: http://stackoverflow.com/a/16865106/492325

Unfortunately I don't have a windows 8 machine to test. If I push a fix to a different branch, would you have the time to re-install the plugin manually to help me test?

from sassbeautify.

WilliamVercken avatar WilliamVercken commented on July 24, 2024

Sure, no problem, with pleasure ! Tell me when I can do it for you.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Thanks man. I think there's some other things we need to verify before pushing any code.

  1. You mention the Command Prompt (with Ruby), what does that mean exactly? Have you tested the sass-convert command (sass-convert --version) using the default command prompt or a powershell prompt?
  2. Are you using RVM or any other ruby version manager, and if so, can you paste your path settings?
  3. Can you paste this into your python console in Sublime Text and let me know the output?:
import subprocess;p=subprocess.Popen(['sass-convert','--stdin','--from','scss','--to','scss'],stdout=subprocess.PIPE,stdin=subprocess.PIPE,stderr=subprocess.PIPE);(stdout, stderr)=p.communicate(input=".test{color:red;}".encode('utf-8'));print("STDOUT %s" % stdout.decode('utf-8'));print("STDERR %s" % stderr.decode('utf-8'));

(Possibly related: http://stackoverflow.com/a/2068329/492325)

from sassbeautify.

WilliamVercken avatar WilliamVercken commented on July 24, 2024

Ruby

image

The one on the left is the default Windows cmd.exe. The other one on the right ("Start Command Prompt with Ruby") is installed with "Ruby Installer". I have to use it to install sass and compass, even on Windows 7

  • If I use the default cmd.exe and execute sass-convert --version i've got this : 'sass-convert' is not recognized as an internal or external command, operable program or batch file.

Console & Output

Here is the result :

>>> import subprocess;p=subprocess.Popen(['sass-convert','--stdin','--from','scss','--to','scss'],stdout=subprocess.PIPE,stdin=subprocess.PIPE,stderr=subprocess.PIPE);(stdout, stderr)=p.communicate(input=".test{color:red;}".encode('utf-8'));print("STDOUT %s" % stdout.decode('utf-8'));print("STDERR %s" % stderr.decode('utf-8'));
Traceback (most recent call last):
  File "", line 1, in 
  File ".\subprocess.py", line 633, in __init__
  File ".\subprocess.py", line 842, in _execute_child
WindowsError: 

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024
If I use the default cmd.exe and execute sass-convert --version i've got this : 'sass-convert' is not recognized as an internal or external command, operable program or batch file.

So this looks like a path issue then. Can you open up the "Start Command Prompt with Ruby" prompt, then paste this in: echo $PATH then add that path to your SassBeautify settings file.

from sassbeautify.

WilliamVercken avatar WilliamVercken commented on July 24, 2024

image
Hummmm.... :p


I had nothing special to do on Windows 7...
I just noticed something : http://rubyinstaller.org/downloads/

If you don’t know what version to install and you’re getting started with Ruby, we recommend you use Ruby 1.9.3 installers. These provide a stable language and a extensive list of packages (gems) that are compatible and updated.
Ruby 2.0.0, specially the 64bits version, are relatively new on the Windows area and not all the packages have been updated to be compatible with it.

I don't know which version I have on Windows 7, but on my Windows 8 I installed Ruby 2.0.0.
I try the other version (1.9.3) and I come back to tell you if it works.

from sassbeautify.

WilliamVercken avatar WilliamVercken commented on July 24, 2024

Okay, the 2.0.0 works, I just made ​​a mistake : when I installed it yesterday, I didn't check the option "Add Ruby executables to your PATH". I didn't know what it meant so I didn't touch it. (And the first time on Windows 7 I followed a tutorial, maybe it was indicate to check it)

Thank you for your help, and sorry for taking your time for nothing. :(

(One good thing : now, you can tell "it works on Windows 8 !")

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

Great that you got it working. Yes this path issue has been quite a problem in the past. No problem man, you haven't wasted my time, I think we both gained some knowledge out of this experience, and indeed it's good to know the plugin does work on Windows 8!

BTW regarding getting the path value, for windows it should have been: echo %path%, my bad!

I'm going to try add some documentation to the README about this which should hopefully help others if they have the same problem.

from sassbeautify.

badsyntax avatar badsyntax commented on July 24, 2024

I've added a bit more info to the README about RubyInstaller: https://github.com/badsyntax/SassBeautify#issues-with-ruby-sass-and-your-path

from sassbeautify.

wijnandmet avatar wijnandmet commented on July 24, 2024

When I do "echo %path% I see a lot of information, but when I try SassBeautify then I get the error:

There was an error beautifying your Sass:
[Errno 32] Broken pipe

No further error information is given. Is there anything I can do to fix it?

EDIT: I got it working. Had to do: gem install sass.

from sassbeautify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.