Comments (51)
For those using RVM on linux, try:
{
"ruby": "~/.rvm/bin/rvm-auto-ruby"
}
from beautifyruby.
What worked for me:
1.Add ruby path to beautifyruby sublime user settings
2.Install htmlbeautifie in global gemset:
rvm use (version)@global
gem install htmlbeautifier
from beautifyruby.
This worked for me
check which ruby version:
which ruby
and update the BeautifyRuby.sublime-settings around line 7:
"ruby": "/usr/bin/env ruby",
to the version you are using
"ruby": "/Users/(your username)/.rvm/rubies/ruby-(your version)/bin/ruby",
from beautifyruby.
Thanks for the tips! I had to do both to get it working
gem install htmlbeautifier
which ruby
Which gave -> /Users/stu/.rvm/rubies/ruby-2.1.0/bin/ruby
and then
{
"ruby": "/Users/stu/.rvm/rubies/ruby-2.1.0/bin/ruby",
}
from beautifyruby.
Do it as following steps will works well both .rb and .html.erb files.
- gem install 'htmlbeautifier'
- add
gem 'htmlbeautifier'
to your project Gemfile. - add
"ruby": "~/.rbenv/versions/2.1.0/bin/ruby"
(maybe RVM) to BeautifyRuby settings.
all done. enjoy it.
from beautifyruby.
Is that the path to ruby when you execute which ruby
?
from beautifyruby.
This exact issue happens to me when installed with package control in sublimetext 3. Moving the package out of package control (extracting the .sublime-package
and moving the whole directory to packages
) fixes the problem. Weird, huh?
from beautifyruby.
Thanks @tamird moving the folder manually under packages
worked!
from beautifyruby.
Not working for me either. Is there a chance for a fix to work with package manager?
from beautifyruby.
I have the same issue. Installed via pkg control in sublimetext 3. And getting check interpreter settings error
from beautifyruby.
+1
from beautifyruby.
same with sublime3 and package control
as @tamird says, manually cloning the project to '~/Library/Application Support/Sublime Text 3/Packages' will solve the problem
from beautifyruby.
Same. install via package control in SB3 not working.
Had to manually copy it over.
from beautifyruby.
how do?
from beautifyruby.
I'm also having this issue. I use ST3 and rbenv. Getting the "check your ruby interpreter settings" error message every time. Any ideas?
from beautifyruby.
Do the manual installation.
Go into your packages directory.
git clone git://github.com/CraigWilliams/BeautifyRuby.git
from beautifyruby.
manual installation
did not work for me. I am running st2
from beautifyruby.
#63 should fix this
from beautifyruby.
still not working for me, st2+ubuntu1204
from beautifyruby.
Is this still not working after @zelig's changes?
from beautifyruby.
@CraigWilliams not working for me
from beautifyruby.
if it is still not working. delete any manual install, and reinstall via package control.
under st2 there shouldn't be a problem
from beautifyruby.
@zelig NOT working for my ubuntu1204+st2, steps:
- clean up all manual install stuff
- install via package control
- have my St user settings file like this:
{
"ruby": "/home/peter/.rbenv/shims/ruby"
}
the error remained Error: invalid output. Check your ruby interpreter settings
when I was running this to a .html.erb file
from beautifyruby.
see README:
Erb html templates uses Paul Battley's htmlbeautifier gem. This (as well as rubygems) is assumed to be installed as seen by the ruby interpreter. Note that if you beautify and erb file but htmlbeautifier is not found, the error message is 'check your ruby interpreter settings', do not be misled.
from beautifyruby.
Updating the ruby version path worked for me. Thanks @jesusjjf
from beautifyruby.
RTFM :)
On 3 February 2014 05:20, Stuart Jones [email protected] wrote:
Thanks for the tips! I had to do both to get it working
gem install htmlbeautifier
which ruby
Which gave -> /Users/stu/.rvm/rubies/ruby-2.1.0/bin/ruby
and then
{
"ruby": "/Users/stu/.rvm/rubies/ruby-2.1.0/bin/ruby",}Reply to this email directly or view it on GitHubhttps://github.com//issues/52#issuecomment-33925469
.
from beautifyruby.
So that fix still wasn't working for me. I narrowed it down to ruby being executed through sublime couldn't load the htmlbeautifier file. This can be seen in this error message:
/home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in require': cannot load such file -- htmlbeautifier (LoadError)
from /home/user/.rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/user/.config/sublime-text-3/Packages/BeautifyRuby/lib/erbbeautify.rb:1:in <main>'
It's weird, because I took the code from beautify_ruby.py and ran it from the command line and it worked just fine. So this has to be something weird with sublime.
Here's how I fixed it.
First I changed the require line in erbbeautifier.rb from
require 'htmlbeautifier'
to the absolute path of the ruby script
require '/home/user/.rvm/gems/ruby-2.1.0/gems/htmlbeautifier-0.0.9/lib/htmlbeautifier.rb'
I was then getting complaints from ruby about how it couldn't find the required files within htmlbeautifier.rb. I has able to fix this by changing require to require_relative for files within the same directory in htmlbeautifier.rb. With that I had to update all of the lib files with require_relative because they all reference files within the same directory.
So with all that I finally got it working. I'm sure there's probably some easier way to fix it though.
from beautifyruby.
I'm having problems using BeautifyRuby in Sublime Text 3 under Mac OS 10.7.5 with Ruby 2.1.0. I installed Ruby via RVM and have installed the htmlbeautifier gem. I can properly format .rb files but I get an error stating "Invalid output. Check your Ruby interpreter settings." when attempting to format html.erb files.
I tried egru's fix by requiring htmlbeautifer using the gem's path, but that did not work.
from beautifyruby.
I have the same problem as @jsmith0684.
I am using rbenv, Ruby 2.1.1, on ArchLinux, Sublime Text 2 Build 2221
gem install htmlbeautifier
rbenv which ruby
/home/mschewe/.rbenv/versions/2.1.1/bin/ruby
{
"tab_or_space": "space",
"ruby": "/home/mschewe/.rbenv/versions/2.1.1/bin/ruby",
"file_patterns": [ "\\.html\\.erb", "\\.rb", "\\.rake", "Rakefile", "Gemfile" ],
"html_erb_patterns": ["\\.html\\.erb"],
"run_on_save": false,
"save_on_beautify": false
}
Are there any solutions or suggestions to this problem?
from beautifyruby.
+1
from beautifyruby.
Broken for me as well on ST3, tried installing via package control and manually neither seem to work. Also installed the htmlbeutifier gem and updated my path to ruby through the package preferences.
from beautifyruby.
Here's what my erbbeautify.rb file looks like:
require '/home/user/.rvm/gems/ruby-2.1.0/gems/htmlbeautifier-0.0.9/lib/htmlbeautifier.rb'
def beautify(input, output)
dest = ""
beautifier = HtmlBeautifier::Beautifier.new(dest)
begin
beautifier.scan(input)
dest << "\n"
rescue
dest = ""
end
output.write(dest)
end
beautify $stdin.read, $stdout
here's my htmlbeautifier.rb.
require_relative 'htmlbeautifier/beautifier'
require_relative 'htmlbeautifier/version'
within the htmlbeautifier directory there are five files. For beautifier.rb, builder.rb, and html_parser.rb, change require to require_relative in each for every dependency. Hope this helps.
from beautifyruby.
hi
i tried everything that was suggested here and it still prints the:
"invalid output. Check your ruby interpreter settings"
i am running sublime 2 on Ubuntu.
please help !
from beautifyruby.
Hi. I also get the error: "invalid output. Check your ruby interpreter settings". Every thing seems to be working for .rb files but not .erb files.
As suggested here, I tried installing htmlbeautifier into my global gem set as well as ergu's solution to manually change the erbbeautify.rb file. Nothing worked.
Any solution for this? I'd love to get this working for my .erb files!
I'm waay too lazy/don't want to format .erb files by hand to make them easy to read. ..My eyes are h- hurting--Please help! I'm on sublime 3 running ubuntu.
from beautifyruby.
I tried everything that was written here. Changed ruby path to path from which ruby and installed htmlbeautifier. Even tried everything with require_relative and direct path to htmlbeautify.
Still getting the same error message.
Ubunt 14.04 and sublime text 3
EDIT:
I found the problem for me.
After trying to beautify the document with htmlbeautifier i got the error code:
Outdented too far on line XX (RuntimeError)
I validated the HTML then and saw that I had a closing tag without an opening tag.
After I changed it everything worked.
If none of the above suggestions help, try validating your HTML code aswell.
from beautifyruby.
Hello, I'm getting the same problem on ST3. Tried pretty much everything suggested on this page, but I still get the same error. Any suggestions for Ubuntu 12.04 and ST3?
from beautifyruby.
thx @nozpheratu, this fixed the erb formatting error for me!
from beautifyruby.
Changing "ruby" to the absolute path worked for me. I'm using rbenv on Yosemite. Probably related to project-specific version settings.
from beautifyruby.
On MacOS 10.8.5 (running Darwin 12.5.0), I had a long time ago created the situation that I had made a 1.9..3 rvm installation which was interfered with by the ruby 1.8.7 installation underneath /System/Library/Frameworks.
This situation also gave rise to 'Invalid output. Check your ruby interpreter settings' as reported above, when installed by cloning from github into Sublime Text 3.
Fortunately, once I had tracked down the 1.9.3 location this was easy to correct by entering
{
"ruby": "~/.rvm/bin/ruby"
}
in ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/BeautifyRuby.sublime-settings
Thanks for all the suggestions above. Fortunately this one was quite easy to fix.
from beautifyruby.
Running ubuntu 14.04 LTS, Sublime Text 3, and Ruby 2.2.0. Ran into the same problem. I followed the steps @stujo gave.
In a nutshell:
- Open your console.
- Type
gem install htmlbeautifier
to install the required htmlbeautifier. - After that's installed, get your Ruby path and version by typing
which ruby
. That should return something similar to this:/Users/stu/.rvm/rubies/ruby-2.1.0/bin/ruby
. Yours will give something different based on your install directory and version, just copy and paste... - In Sublime Text 3: Preferences > Package Settings > BeautifyRuby > Settings - Default add this line before the closing
}
:"ruby": "/Users/stu/.rvm/rubies/ruby-2.1.0/bin/ruby"
but paste your path that you copied from the console inside the quotation marks. - Make sure to add a
,
to the end of the previous line before the one you added.
That got mine working. Thanks stujo.
from beautifyruby.
This still doesn't work for me? I'm not even using rvm so i'm just linking to /usr/bin/ruby... I have no problems with .rb files - just .html.erb files
from beautifyruby.
@RONNCC Did you install the htmlbeautifier gem as mentioned in the readme?
from beautifyruby.
Yup and I put my ruby path using where and I changed the requires to the
direct path of the htmlbeautifier as suggested above
On Mon, Mar 30, 2015, 12:18 PM nozpheratu [email protected] wrote:
@RONNCC https://github.com/RONNCC Did you install the
https://github.com/threedaymonk/htmlbeautifier http://htmlbeautifier
gem as mentioned in the readme?—
Reply to this email directly or view it on GitHub
#52 (comment)
.
from beautifyruby.
Tried everything in this post and no luck.
What might be worth noting is I only get the error on saving .html.erb files.
I'm running:
- OSX
- Sublime 3
- Installed from package manager
- RVM
- Ruby 2.12.
from beautifyruby.
^ exact same. I only get the error on .html.erb files as well
i'm using Sublime 3 in a Ubuntu 14.04 vm installed from package manager (and then manually) without an RVM and Ruby 2.2.1 i believe
from beautifyruby.
@Josh-Kes his instructions worked for me. Thanks
from beautifyruby.
@stujo Your solution works for me, thanks!!!
from beautifyruby.
I was using chruby, and I had updated my system ruby to 2.1.5 using postmodern's ruby-install. The above solutions did not work, without a little finesse.
What finally worked for me (even after changing the beautifyruby sublime user settings ruby path to /Users/prokizzle/.rubies/ruby-2.1.5/bin/ruby
) was running:
/usr/bin/gem install htmlbeautifier
Now everything is great.
from beautifyruby.
Thanks @lizhangyuh, it works for me.
from beautifyruby.
with rbenv, this works for me
rbenv which ruby
"ruby": "/Users/gonzalomoreno/.rbenv/versions/2.0.0-p353/bin/ruby"
from beautifyruby.
Doesn't work. I still get the error on .html.erb files "Error: invalid output. Check your ruby interpreter settings"
- Sublime Text 3
- OSX (Sierra 10.12.6 )
- htmlbeautifier - installed
"ruby": "/opt/rubies/ruby-2.4.1/bin/ruby"
I tired with installed from package manager & cloned (git clone git://github.com/CraigWilliams/BeautifyRuby.git)
from beautifyruby.
Related Issues (20)
- Error: invalid output. Check your ruby interpreter setting (only with ERB files) HOT 8
- Align parameters according to the standard and/or Rubocop HOT 2
- Incorrect Indentation of Comments HOT 2
- multiline method chaining with leading dots HOT 1
- Heredoc EOF Indented HOT 1
- Is it possible to set tab size for different type of file?
- How to add space at both sides of “+” etc
- Empty lines
- Can you run beautifyRuby on project.
- ERROR: This is not a ruby file
- Ruby 3.0 single line methods support
- After %x command rest of file is super indented HOT 3
- BeautifyRuby changes tab_size to 4 HOT 2
- Case Statements Not Indenting HOT 1
- Parameters not aligned for multiline method calls with no parenthesis
- `class` hash key break alignment when starting a line
- Indents incorrectly for odd tab_size HOT 1
- Turn off beautify for regions? HOT 1
- Unexpected Indentation
- case without matcher HOT 2
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 beautifyruby.