Error Building Ruby in Sublime Text Editor
The problem seems to be the ~ in your Ruby command path.
It may not be very general, but try to change
"cmd": ["~/.rvm/bin/rvm-auto-ruby", "$file"]
with
"cmd": ["/home/your_username/.rvm/bin/rvm-auto-ruby", "$file"]
Sublime Text 3 can't compile ruby
I was having the same issue. Saving the file before building it in Sublime Text resolved it.
- Save File
- ctrl + B to build
- Output appears in the build window
Running RubyTest in Sublime Text 3 throws errors
Looks like the issue was with rbenv-gemset. Bundler was installed in a gemset, and Sublime wasn't picking it up. As soon as I removed rbenv-gemset and ran gem install bundler
, everything worked as expected.
Sublime text can't understand gets.chomp
Sublime can't handle interactive input on its own. You can either run your script through SublimeREPL or create a customized build system to open a command prompt and then run the code. Fortunately, this isn't too difficult. Create a new file in Sublime with the following contents:
{
"cmd": ["start", "cmd", "/k", "c:/ruby193/bin/ruby.exe", "$file"],
"selector": "source.ruby",
"shell": true,
"working_dir": "$file_dir"
}
Save it as Packages/User/Ruby_cmd.sublime-build
, where Packages
is the directory opened when selecting Preferences -> Browse Packages...
. Select Tools -> Build System -> Ruby_cmd
, and run your file with CtrlB.
This should work on all versions of Windows from XP on up. It is not intended for OSX or Linux, though, as they don't have the start
and cmd
programs...
Related Topics
How to Access Current_User Object in Model
Best Way to Find_Or_Create_By_Id But Update the Attributes If the Record Is Found
Having Difficulty Accessing Validation Errors in Sinatra
Linking Two Models in a Multi-Model Form
Convert Ip Address to 32 Bit Integer in Ruby
If 'Self' Is Always the Implied Receiver in Ruby, Why Doesn't 'Self.Puts' Work
Find Both Pattern and Position of Multiple Regex Matches in Ruby
Error Installing "Kgio-2.9.2" Gem on Windows
Selenium2 Webdriver Ruby => How Click on a Hidden Link
How to Listen to Stdin Input Without Pausing My Script
Rails Generate Controller Gives Me Load Error
Parsing Large Xml with Nokogiri
Markdown to Plain Text in Ruby
Unexpected Keyword_End, Expecting $End (Syntaxerror)
Rails Form Object with Reform-Rails with Collections Not Working or Validating