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

Error: invalid output. Check your ruby interpreter setting (only with ERB files) #101

Open
dwkns opened this issue Jan 16, 2016 · 8 comments

Comments

@dwkns
Copy link

dwkns commented Jan 16, 2016

On OS X 10.11.2 - Sublime Text 3

I have the htmlbeautifier gem (1.1.1) properly installed. From the terminal htmlbeautifier my_file.html.erb works as expected and beautifies the file.

The plugin is installed (via package control) and works for standard ruby (.rb) files.

However the I get the 'Error: invalid output. Check your ruby interpreter setting' error whenever I try to beautify a .erb file within Sublime.

Any ideas?

@atstockland
Copy link

I'm experiencing this too. The README addresses this...but even with the htmlbeautifier gem installed, I still get the error.

@monjer
Copy link

monjer commented May 24, 2017

I came accross this issue too . System :** OS X EL Capitan** , version 10.11.5 , with sublime3, When i use the short cut in *.html.erb file , there always be a alert showing :

Error: invalid out put. Check your ruby interpreter settings .

I have install ruby with brew. Ruby version is :

ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin15]

@monjer
Copy link

monjer commented May 24, 2017

After google , I think I get the right answer , In my situation , because I reinstall the ruby with brew , I have to change the ruby path in the preference of BeautifyRuby .

So change to preferences > package settings > beautify ruby > settings default , and add the option "ruby": "path/of/ruby"

save the prefernce and all is done.

you can check the solution in stackoverflow:

@jabbett
Copy link

jabbett commented Jun 6, 2017

To save the next visitor a click, the secret is to tell rvm to use your global gemset:

$ which ruby
/Users/jonathan/.rvm/rubies/ruby-2.3.3/bin/ruby
$ rvm use 2.3.3@global
Using /Users/jonathan/.rvm/gems/ruby-2.3.3 with gemset global
$ gem install htmlbeautifier

or

$ rvm @global do gem install htmlbeautifier

@madeindjs
Copy link

For me $ sudo gem install htmlbeautifier worked

@benkoshy
Copy link
Contributor

benkoshy commented Aug 6, 2018

Solutions

  1. Make sure you point sublime to your ruby path.
  2. Make sure you have the htmlbeautifier ruby gem installed.

1. Ruby Path:

image

// this is for rbenv; change the ruby path if you are using rvm or another ruby version manager:
{
    "ruby": "~/.rbenv/shims/ruby",  
    "file_patterns": ["\\.html\\.erb", "\\.rb", "\\.rake", "Rakefile", "Gemfile", "Vagrantfile"],
    "html_erb_patterns": ["\\.html\\.erb"],
    "run_on_save": true,
    "save_on_beautify": true
}

2. Install htmlbeautifier

Should I sudo install a gem?...with the utmost respect, consider carefully whether sudo installing gems is something you should do.

You can simply use rbenv and: gem install htmlbeautifier, with the above settings, and hopefully it will Just Work (TM).

@mahmoudRateb
Copy link

@jabbett Helped alot!!! Thanks!! :)

@sljmn
Copy link

sljmn commented Feb 18, 2024

@benkoshy this worked, thanks!!

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

No branches or pull requests

8 participants