Index: ruby/platform/src/org/netbeans/api/ruby/platform/RubyInstallation.java =================================================================== RCS file: /cvs/ruby/platform/src/org/netbeans/api/ruby/platform/RubyInstallation.java,v retrieving revision 1.35.2.1 diff -u -u -r1.35.2.1 RubyInstallation.java --- ruby/platform/src/org/netbeans/api/ruby/platform/RubyInstallation.java 12 Nov 2007 18:39:06 -0000 1.35.2.1 +++ ruby/platform/src/org/netbeans/api/ruby/platform/RubyInstallation.java 26 Nov 2007 23:51:56 -0000 @@ -779,6 +779,14 @@ * @return The actual root the in the system the file is under. */ public FileObject getSystemRoot(FileObject file) { + // Don't initialize the Ruby interpreter here if it hasn't already been initialized + // (see issue #121477). Our class path resolver may be called even when there are no + // Ruby projects open, and we don't want to make the user ask about Ruby interpreters + // in that case. + if (ruby == null) { + return null; + } + // See if the file is under the Ruby libraries FileObject rubyLibFo = getRubyLibFo(); FileObject rubyStubs = getRubyStubs(); Index: ruby/projects/src/org/netbeans/modules/ruby/rubyproject/RubyProject.java =================================================================== RCS file: /cvs/ruby/projects/src/org/netbeans/modules/ruby/rubyproject/RubyProject.java,v retrieving revision 1.7 diff -u -u -r1.7 RubyProject.java --- ruby/projects/src/org/netbeans/modules/ruby/rubyproject/RubyProject.java 13 Oct 2007 17:37:46 -0000 1.7 +++ ruby/projects/src/org/netbeans/modules/ruby/rubyproject/RubyProject.java 26 Nov 2007 23:51:56 -0000 @@ -54,6 +54,7 @@ import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectInformation; import org.netbeans.api.project.ProjectManager; +import org.netbeans.api.ruby.platform.RubyInstallation; import org.netbeans.modules.ruby.rubyproject.classpath.ClassPathProviderImpl; import org.netbeans.modules.ruby.rubyproject.queries.RubyProjectEncodingQueryImpl; import org.netbeans.modules.ruby.rubyproject.ui.RubyLogicalViewProvider; @@ -386,6 +387,9 @@ ProjectOpenedHookImpl() {} protected void projectOpened() { + // Force Ruby interpreter initialization + RubyInstallation.getInstance().getRuby(false); + // Check up on build scripts. /* try { Index: ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/RailsProject.java =================================================================== RCS file: /cvs/ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/RailsProject.java,v retrieving revision 1.12 diff -u -u -r1.12 RailsProject.java --- ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/RailsProject.java 26 Oct 2007 21:07:46 -0000 1.12 +++ ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/RailsProject.java 26 Nov 2007 23:51:57 -0000 @@ -53,6 +53,7 @@ import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectInformation; import org.netbeans.api.project.ProjectManager; +import org.netbeans.api.ruby.platform.RubyInstallation; import org.netbeans.modules.ruby.railsprojects.classpath.ClassPathProviderImpl; import org.netbeans.modules.ruby.railsprojects.queries.RailsProjectEncodingQueryImpl; import org.netbeans.modules.ruby.railsprojects.server.RailsServer; @@ -382,6 +383,9 @@ public ProjectOpenedHookImpl() {} protected void projectOpened() { + // Force Ruby interpreter initialization + RubyInstallation.getInstance().getRuby(false); + open(); }