Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined method `require_relative' for main:Object when running build from sublime

I've got everything working from my command line so I can run ruby myfile and it works. But when I try to run it from within sublime I get

undefined method `require_relative' for main:Object

Anyone know what is missing in my sublime setup? I am using OS X and has rvm installed.

like image 716
Tomas Jansson Avatar asked Mar 06 '13 07:03

Tomas Jansson


2 Answers

Alternatively, you could just use 'require' and it should work just fine. I think 'require_relative' is only available for ruby 1.9+

like image 113
shortdiv Avatar answered Nov 01 '22 19:11

shortdiv


It's probably because sublime runs 1.8.7 version of ruby. You could change it. Here is how.

like image 30
Yevgeniy Anfilofyev Avatar answered Nov 01 '22 19:11

Yevgeniy Anfilofyev