Comments (23)
Please let me know what version of sass and sass-convert you're using.
from sassbeautify.
Can you also run this from the cli and let me know the output?
sass-convert --indent 4 --to scss --stdin <<< ".test{color:red}"
from sassbeautify.
Sure, I am using sass version 3.2.10.
The output for test is:
.test {
color: red;
}
from sassbeautify.
That doesn't make sense to me. This plugin is simply a wrapper around sass-convert. If you can run sass-convert from the CLI you should be able to run it from this plugin.
- What OS version are you on?
- Have you tried uninstalling and re-installing?
- Can you let me know what plugin version you're using? (Package Controll >> List packages)
- Do you have custom plugin settings? If so paste them here..
Thanks.
from sassbeautify.
- What OS version are you on?
- OSX Mountain Lion 10.8.4
- Have you tried uninstalling and re-installing?
- Yes
- Can you let me know what plugin version you're using? (Package Controll >> List packages)
- 2013.08.12.20.57.29
- Do you have custom plugin settings? If so paste them here.
- I do not have any custom plugin settings. My User/SassBeautify.sublime-settings file is empty
from sassbeautify.
I'm almost out of ideas on this one. Do you get this error for every file you try to beautify?
Can you please try the following:
Before beautifying, can you open up the Sublime Text console: View >> Show Console
Then try beautifying, then copy and paste the debug text here.
Thanks.
from sassbeautify.
(1) Do you get this error for every file you try to beautify?
Yes, and I have tried both scss and sass files.
(2) Console Log:
error: There was an error beautifying your Sass:
OptionParser::InvalidOption: invalid option: --indent
Use --trace for backtrace.
from sassbeautify.
Ok, we're going to have to break it down.
Can you paste this into the console in sublime text and let me know the output?
import os;import subprocess;process=subprocess.Popen(['sass-convert','--unix-newlines','--stdin','--indent', '4','--to', 'scss'],env=os.environ.copy(),stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE);output,err=process.communicate(input=".test{color:red}".encode('utf-8'));output=output.decode('utf-8');err=err.decode('utf-8');print(output);print(err);
from sassbeautify.
The console output from your string was:
OptionParser::InvalidOption: invalid option: --indent
Use --trace for backtrace.
If I remove --indent 4 from your string I receive this out put:
.test {
color: red; }
This got me thinking and so I tried to run sass-convert --indent file.scss --to scss
from the terminal and I received the same error. I then ran sass-convert --indent 4 file.scss --to scss
and I had success, the console gave me to correct output with formatting. Could there be an issue with sass-convert not recognizing the indentation parameter?
I hope this helps. Thank you for taking the time to look into this.
from sassbeautify.
Man this is really weird, I just can't replicate what you're seeing. It's quite frustrating. Thanks for holding out with me.
At this stage, we only know this much:
- sass-convert works as expected from the terminal
- sass-convert does not work as expected when run from Sublime Text.
- The output that you get, when running sass-convert without --indent from sublime text, is not the default output for sass-convert. (The closing brace should be on a new line.)
The above points suggest a different version of sass-convert is being used when run from sublime text.
- In terminal, can you let me know the output of
which sass-convert
- In sublime text console, can you let me know the output of
import os;print(os.environ.copy())
- In sublime text console, can you let me know the output of the following:
import os;import subprocess;process=subprocess.Popen(['which','sass-convert'],env=os.environ.copy(),stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE);output,err=process.communicate();output=output.decode('utf-8');err=err.decode('utf-8');print(output);print(err);
from sassbeautify.
- In terminal, can you let me know the output of which sass-convert
- Sass 3.2.10 (Media Mark)
- In sublime text console, can you let me know the output of import os;print(os.environ.copy())
-
os;print(os.environ.copy())
<module 'os' from '/Applications/Sublime Text.app/Contents/MacOS/python3.3.zip/os.pyo'>
{'LOGNAME': 'me', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'SSH_AUTH_SOCK': '/tmp/launch-sTpFGW/Listeners', 'HOME': '/Users/me', 'SHELL': '/bin/bash', '__CF_USER_TEXT_ENCODING': '0x1F5:0:0', 'TMPDIR': '/var/folders/m6/fzblr91575v9yv1_zvcb4v3r0000gn/T/', 'Apple_PubSub_Socket_Render': '/tmp/launch-scoBeX/Render', 'USER': 'me', 'Apple_Ubiquity_Message': '/tmp/launch-Icux4R/Apple_Ubiquity_Message', 'COMMAND_MODE': 'unix2003'}
-
- In sublime text console, can you let me know the output of the following: import os;import...
-
import os;import subprocess;process=subprocess.Popen(['which','sass-convert'],env=os.environ.copy(),stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE);output,err=process.communicate();output=output.decode('utf-8');err=err.decode('utf-8');print(output);print(err);
/usr/bin/sass-convert
-
from sassbeautify.
When typing which sass-convert
in terminal, i would expect a path, like " /usr/bin/sass-convert". Can you try that again?
from sassbeautify.
Sure, it looks as though terminal is referencing the gem location.
/Users/me/.rvm/gems/ruby-1.9.3-p125/bin/sass-convert
from sassbeautify.
I checked my /usr/bin/ and the version of sass was from last 2012. I reinstalled sass (which sass-convert now points to /usr/bin/) and now SassBeautify is working like a charm. Not sure why it was referencing the gem location. Great support, thank you for helping me out with this.
from sassbeautify.
Ahhh, RVM!! Yea RVM will change your PATH which is why a different sass version was being used in SassBeautify. This has caused issues for others as well, which is why I added a custom path option to this plugin.
If you want to continue to use RVM, you can try add the RVM sass bin folder path to the SassBeautify settings. (There's probably a more elegant solution, but I haven't figured it out yet as I'm not entirely familiar with RVM.)
I'm just glad we got there in the end! 👍
from sassbeautify.
Hello
I am having problems with this same error. I try to edit the file SassBeautify.sublime-settings with the new path /usr/bin/ and I didn't have lucky. I also reinstalled sass and also I am using RVM.
Any help please! I have big sass files....
from sassbeautify.
@Estlopacu Type the following into terminal and let me know the output: which sass-convert
from sassbeautify.
This /Users/estebanlopez/.rvm/gems/ruby-1.9.3-p429/bin/sass-convert
from sassbeautify.
If you add /Users/estebanlopez/.rvm/gems/ruby-1.9.3-p429/bin
to the plugin path setting it should work. I'm going to try add a new feature to this plugin to add the RVM ruby path automatically. I'm tracking that with issue #18.
from sassbeautify.
@Estlopacu Actually adding that path will probably not work. I've reopened issue #1 and am working on a proper fix for this.
from sassbeautify.
I think we can finally put this one to bed: https://github.com/badsyntax/SassBeautify#compatibility-with-rvm
Upgrade to the latest version (which includes a PATH fix):
- Open up the command pallete (cmd/ctrl + shift + p)
- Select: "Package Control: Upgrade Package"
- Select SassBeautify
from sassbeautify.
It works perfect! Thanks for you help.
Pura vida!! as we say in my country Costa Rica.
from sassbeautify.
Very happy to hear, thank you :) RVM has caused me many headaches and I'm glad to finally figure out how it modifies the environment settings.
from sassbeautify.
Related Issues (20)
- General config file in repo for sharing between developers
- Not working after latest ST3 Update HOT 2
- Option to re-order css properties on beautify HOT 3
- Leading zero HOT 1
- [Errno 2] No such file or directory: 'sass-convert' HOT 7
- Indentation HOT 4
- Extra line between comment and closing bracket HOT 1
- Add missing semicolons automatically rather than sass-convert throwing error
- Double quotes in single quotes are changed on compile
- Simply not working
- it does't work and throw a error 'UnicodeDecodeError'
- UTF-8 not supported
- SassBeautify throwing the following error - No such file or directory 'sass-convert' HOT 9
- Attempting to use BEM methodology Sass breaks formatting
- Ability to set FinalNewline to true HOT 1
- [Errno 2] No such file or directory: 'sass-convert' HOT 2
- Double quotes are changed on compile
- Allow manual use on non .scss/.sass/.css files. HOT 1
- Error
- going insane
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sassbeautify.