sketchup-ruby-api-tutorials icon indicating copy to clipboard operation
sketchup-ruby-api-tutorials copied to clipboard

RubyMine project Setup for plugins outside of Sketchup Folder

Open Voulz opened this issue 8 years ago • 5 comments

Hi,

I tried to setup a RubyMine project based on the wiki which was nicely explaining everything step by step, but I wasn't able to actually load the sketchup script I made. It took me a while to get that Sketchup wouldn't load my script because it was outside of the plugin directory.

As the example in the wiki actually point to the folder "C:\Users\tthomas2\SourceTree\testup-2" (as seen here), I was thinking that RubyMine was telling Sketchup a way or another to load my plugin.

Then I found this page explaining that I need a rb file inside of my plugin folder that adds my plugin folder to the $LOAD_PATH.

Anyway, I feel like this should be part of the wiki for the next person to wonder here to know about that.

Voulz avatar Feb 11 '17 07:02 Voulz

Oh! Yes, absolutely - that is a critical omission from the tutorial. Thank you for reporting that!

thomthom avatar Feb 11 '17 07:02 thomthom

By the way, yesterday I found a better way to provide code insight to RubyMine;

  1. Remove the folder reference your cloned version of: https://github.com/SketchUp/ruby-api-stubs
  2. Add a Gemfile in your root of your project folder. (Yes, with no file extension)
source 'https://rubygems.org'

group :development do
  gem 'minitest'
  gem 'sketchup-api-stubs'
end

RubyMine should then detect that your project rely on those gems and install them for you. This have the benefit of not needing to add require "sketchup.rb" on top of each file just to be able to get auto-complete from RubyMine.

thomthom avatar Feb 11 '17 07:02 thomthom

Seems interesting, I'll check that when I have time!

Voulz avatar Feb 11 '17 10:02 Voulz

@thomthom (again) I feel this issue was not a "Ruby API Tutorials" issue. This issue should be moved to the Debugger or a new repo on using VSCode or other IDEs.

DanRathbun avatar Jun 21 '20 19:06 DanRathbun