Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in `require': cannot load such file -- extensions.rb (LoadError) #15

Open
renchiyuan opened this issue Dec 27, 2018 · 15 comments
Open

in `require': cannot load such file -- extensions.rb (LoadError) #15

renchiyuan opened this issue Dec 27, 2018 · 15 comments

Comments

@renchiyuan
Copy link

Need help. I don't know what is wrong. require "extensions.rb" cant find the file. But require "sketchup.rb" is right.

@thomthom
Copy link
Member

thomthom commented Jan 9, 2019

Are you getting this error from one of the examples?
Can you post the full error, including the backtrace?

@thomthom
Copy link
Member

thomthom commented Jan 9, 2019

What version of SketchUp?
What platform? Windows or Mac?

@bkvsy
Copy link

bkvsy commented Feb 19, 2019

I think I have similar issue here. After setting VSCode on win10 according to wiki I'm getting "Required path extensions.rb could not be resolved." from solargraph.
I'm using Sketchup 2018

sgerr

@thomthom
Copy link
Member

I think I have similar issue here. After setting VSCode on win10 according to wiki I'm getting "Required path extensions.rb could not be resolved." from solargraph.
I'm using Sketchup 2018

@bkvsy - what does your .solargraph.yml file look like?

It would need to have a path to the SketchUp Tools directory where this file is located. See example in the VSCode project example we recently created:

https://github.com/SketchUp/sketchup-extension-vscode-project/blob/955260622c15048532b47f1c5f2ca5a36a7e81b7/.solargraph.yml#L2

@thomthom
Copy link
Member

Link to the front page of the VSCode example repository: https://github.com/SketchUp/sketchup-extension-vscode-project

@thomthom
Copy link
Member

Oh, just noticed the comment that sketchup.rb isn't flagged. If you jump to that file (F12 when you have the caret set to that line) what file does VSCode open?

@bkvsy
Copy link

bkvsy commented Feb 20, 2019

@thomthom my .solargraph.yml was copied from the Wiki

I'm maybe doing something wrong here but pressing F12 in VS in any configuration produces no results.

Surprisingly, when I copied your sketchup-extension-vscode-project repo and changed require_paths in .solargraph.yml to some random path on different drive and added random .rb in 'require' section Solargraph is not reacting.

sgerr2

@thomthom
Copy link
Member

Surprisingly, when I copied your sketchup-extension-vscode-project repo and changed require_paths in .solargraph.yml to some random path on different drive and added random .rb in 'require' section Solargraph is not reacting.

Is there any message in the statusbar about Solargraph not starting?

I some times open the VSCode Developer Console to check for hints to errors preventing solargraph from starting. (Help > Toggle Developer Tools)

Do you see any hints there?

Btw, what version of Ruby and the Solargraph gem do you have installed?

@bkvsy
Copy link

bkvsy commented Feb 21, 2019

Ruby version 2.5.3p105
Solargraph 0.31.3

Warnings from dev tools:
log

@thomthom
Copy link
Member

Hm... that is strange. I don't see any issues there.
Could you perhaps zip you a minimal example where the require 'extensions.rb' isn't working and attach it here? Maybe there is some subtle difference in our configs...

@bkvsy
Copy link

bkvsy commented Feb 22, 2019

InitialSkpIDE.zip

@thomthom
Copy link
Member

I'm seeing the same thing on my machine. I'll dig into and see if I can figure out what is going on.

@thomthom
Copy link
Member

Turns out I've gone through this before - I'd just forgotten.

Currently solargraph expects the require_paths to be relative to the .solargraph.yml file. So the Program Files path doesn't do anything right now.

And in my own projects and the VSCode example (https://github.com/SketchUp/sketchup-extension-vscode-project/blob/master/.solargraph.yml) the require_not_found reporter is excluded from the set of reporters. Only rubocop is enabled.

reporters:
- rubocop

@bkvsy
Copy link

bkvsy commented Feb 25, 2019

Thank you sensei @thomthom
Copying references from .../Tools/ to the repository path is working for me

@DanRathbun
Copy link

@thomthom So apparently this issue was solved. But (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants