Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML (ERB) - htmlbeautifier custom path #232

Closed
watzon opened this issue Mar 10, 2015 · 10 comments
Closed

HTML (ERB) - htmlbeautifier custom path #232

watzon opened this issue Mar 10, 2015 · 10 comments
Assignees
Milestone

Comments

@watzon
Copy link

watzon commented Mar 10, 2015

I have installed htmlbeautifier through the command gem install htmlbeautifier but when I try to run your beautifier on HTML I get this error

Command failed: /bin/sh -c [ -f ~/.bash_profile ] && source ~/.bash_profile;[ -f ~/.bashrc ] && source ~/.bashrc;htmlbeautifier < "/var/folders/s_/sqlhgb657c51smfrcpk7x2x00000gn/T/input115210-78658-j6w5bi" > "/var/folders/s_/sqlhgb657c51smfrcpk7x2x00000gn/T/115210-78658-ks7f94" /bin/sh: htmlbeautifier: command not found

@Glavin001 Glavin001 changed the title Can't get it to work on Mac HTML (ERB) not working - cannot find htmlbeautifier command Mar 10, 2015
@Glavin001 Glavin001 self-assigned this Mar 10, 2015
@Glavin001
Copy link
Owner

Looks like there currently is not an option for setting the path to htmlbeautifier (see beautifier code at https://github.com/Glavin001/atom-beautify/blob/master/lib/langs/html-erb-beautify.coffee ).

  • add option to set path of htmlbeautifier

Currently Atom Beautify attempts to automatically detect htmlbeautifer and other installed beautifiers with the line:

/bin/sh -c [ -f ~/.bash_profile ] && source ~/.bash_profile;[ -f ~/.bashrc ] && source ~/.bashrc;

Test to see where you htmlbeautifier path is with:

which htmlbeautifier

For instance, mine returns: /usr/bin/htmlbeautifier
What's yours?

It's strange that gem did not setup either your .bash_profile or .bashrc files such that running the special script (shown above) did not find it automatically. This will be fixed with #164.

@Glavin001 Glavin001 reopened this Mar 10, 2015
@Glavin001 Glavin001 added this to the v1.0.0 milestone Mar 10, 2015
@watzon
Copy link
Author

watzon commented Mar 10, 2015

Mine returns /Users/chriswatson/.rvm/rubies/ruby-2.1.5/bin/htmlbeautifier. Is it possible to reinstall the gem in /usr/bin?

@Glavin001
Copy link
Owner

I am not a Ruby developer, so I am not really sure what you can and cannot do with gem, sorry. Let me know if you find out those! 😄

Maybe there is something you could do with Bash aliases in either .bashrc or .bash_profile: http://tldp.org/LDP/abs/html/aliases.html

Maybe the following (untested):

alias htmlbeautifer='/Users/chriswatson/.rvm/rubies/ruby-2.1.5/bin/htmlbeautifier'

@watzon
Copy link
Author

watzon commented Mar 10, 2015

The funny thing is if I run htmlbeautifier in terminal it works. It just flakes out and throws that error within Atom. I don't really know coffee well enough to fix it for myself either /.\ haha

@Glavin001
Copy link
Owner

Published to v0.21.6

Usage: take that htmlbeautifier path and go into Atom Beautify's package settings, and find htmlbeautifier path and enter it there. Then try to beautify.
Let me know if it works. Thanks!

@watzon
Copy link
Author

watzon commented Mar 12, 2015

Dang I thought that would work. I just got this

Command failed: /bin/sh -c [ -f ~/.bash_profile ] && source ~/.bash_profile;[ -f ~/.bashrc ] && source ~/.bashrc;"/Users/chriswatson/.rvm/rubies/ruby-2.1.5/bin/htmlbeautifier" < "/var/folders/s_/sqlhgb657c51smfrcpk7x2x00000gn/T/input115212-87663-3icos6" > "/var/folders/s_/sqlhgb657c51smfrcpk7x2x00000gn/T/115212-87663-3l8iqw" env: ruby_executable_hooks: No such file or directory

I checked the directory and it does exist so what am I doing wrong?

@Glavin001
Copy link
Owner

Try: http://stackoverflow.com/a/26370576/2578205
So /Users/chriswatson/.rvm/rubies/ruby-2.1.5/bin/htmlbeautifier becomes /Users/chriswatson/.rvm/rubies/ruby-2.1.5/wrappers/htmlbeautifier

@watzon
Copy link
Author

watzon commented Mar 12, 2015

What is going on here?! Haha

Command failed: /bin/sh -c [ -f ~/.bash_profile ] && source ~/.bash_profile;[ -f ~/.bashrc ] && source ~/.bashrc;"/Users/chriswatson/.rvm/rubies/ruby-2.1.5/wrappers/htmlbeautifier" < "/var/folders/s_/sqlhgb657c51smfrcpk7x2x00000gn/T/input115212-87663-1rwyswl" > "/var/folders/s_/sqlhgb657c51smfrcpk7x2x00000gn/T/115212-87663-4rvura" /bin/sh: /Users/chriswatson/.rvm/rubies/ruby-2.1.5/wrappers/htmlbeautifier: No such file or directory

@Glavin001
Copy link
Owner

I am not a Ruby developer, so I have no idea 😝. Unfortunately, I don't think I'll be much help. I'd recommend searching around for your issue ruby_executable_hooks: No such file or directory and if you do find anything let me know so that we can fix this once and for all.
I hope you have better luck! Thanks.

@Glavin001 Glavin001 reopened this Mar 12, 2015
@Glavin001 Glavin001 changed the title HTML (ERB) not working - cannot find htmlbeautifier command HTML (ERB) - htmlbeautifier custom path Mar 12, 2015
@Glavin001
Copy link
Owner

I just tested using the custom htmlbeautifier path set via Atom Beautify's Package settings. Everything worked smoothly, so I am closing this issue.

Hopefully you have some luck with your Ruby installation issue, @iDev0urer .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants