BeautifyRuby
BeautifyRuby copied to clipboard
Error: invalid output. Check your ruby interpreter setting (only with ERB files)
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?
I'm experiencing this too. The README addresses this...but even with the htmlbeautifier gem installed, I still get the error.
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]
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:
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
For me $ sudo gem install htmlbeautifier
worked
Solutions
- Make sure you point sublime to your ruby path.
- Make sure you have the
htmlbeautifier
ruby gem installed.
1. Ruby Path:
// 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).
@jabbett Helped alot!!! Thanks!! :)
@benkoshy this worked, thanks!!