I'm usingn Aptana Studio 3 on Mac High Sierra. I have imported my Rails 5 project and set "Rails" as my project natures in the "Properties" section of my project. However when editing some Ruby files, Aptana is incorrectly reporting syntax errors on the left side of the editor. For example, this line
creds = PasswordService.find_user(params[:login])&.object
is flagged with this error
syntax error, unexpected tDOT
even though this doesn't raise any errors when I run my project. I'm wondering if Aptana is not picking up the correct version of Ruby associated with my project but I'm not sure how to check/set that.
I don't use Aptana, but maybe you want to set your Ruby version too because the safe navigation
&is a Ruby feature. In the project directory runruby -vin the console and check the ruby version, it must be higher than 2.3.If you use a ruby version manager (rbenv or rvm) make sure you configure the right Ruby version for the project.