Reputation: 21
I am currently running Sublime Text 3 and use rbenv with ruby version 2.3.0. I installed Beatify Ruby from Package Control but it will not run correctly. I am currently getting an error every time I run BeautifyRuby in Sublime, it states:
Error: invalid output. Check your ruby interpreter settings
What is the best way to go about getting Beautify Ruby to work?
Upvotes: 2
Views: 1197
Reputation: 374
If you get this error, BeautifyRuby doesn't seem to know where your ruby-interpreter resides (which it needs to run ruby-scripts that perform the "Beautifying"). To solve this, you need to specify your ruby interpreter by providing a correct interpreter-path in the BeautifyRuby-Package-settings:
which ruby
in your terminal. This gives you something like /home/<yourusername>/.rbenv/shims/ruby
(if you use rbenv) or ~/.rvm/bin/rvm-auto-ruby
(if you use rvm)Preferences > Package Settings > BeautifyRuby > Settings - Default
{
// Specify your ruby interpreter:
"ruby": "~/.rvm/bin/rvm-auto-ruby",
// Examples for other settings:
// Use 2 Spaces instead of tabs:
"translate_tabs_to_spaces": true,
"tab_size": 2,
// You can change the file patterns handled by this plugin:
"file_patterns": ["\\.html\\.erb", "\\.rb", "\\.rake", "Rakefile", "Gemfile", "Vagrantfile"],
"html_erb_patterns": ["\\.html\\.erb"],
// This package offers a pre-save hook; when activated, your ruby and erb files will
// be reformatted automatically before saving (deactivated by default)
"run_on_save": false,
// The sublime command "beautify_ruby" performs a save after formatting.
// (activated by default)
"save_on_beautify": false
}
ctrl+alt+k
if I'm not mistaken) - and your code should have been "beautified". For more details, check the project-pages - on GitHub or packagecontrol.io
Upvotes: 1
Reputation: 406
Try open sublime from shell cd project_forler && subl .
or open Preferences -> Package Settings -> BeautifyRuby -> Settings Default
find "ruby": "ruby"
and replace to your ruby path
Upvotes: 0