SketchUp / sketchup-ruby-api-tutorials

SketchUp Ruby API Tutorials and Examples
MIT License
213 stars 145 forks source link

RubyMine project Setup for plugins outside of Sketchup Folder #8

Open Voulz opened 7 years ago

Voulz commented 7 years ago

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.

thomthom commented 7 years ago

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

thomthom commented 7 years ago

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.

Voulz commented 7 years ago

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

DanRathbun commented 4 years ago

@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.

burncode commented 7 months ago

After a long time of unsuccessful debugging, we finally found the problem here.