简体   繁体   中英

Running Ruby Koans in Netbeans 6.9.1

I'm very new to Ruby, and currently running through the Ruby Koans to get a better feel for the language. My IDE is NetBeans 6.9.1.

I have created a new Ruby project from existing source, and pointed it to where I installed my Ruby Koan files (C:\\rubykoans\\koans)

I can successfully run the Koans from the command prompt with the command:

ruby path_to_enlightenment.rb

I have set my project properties in NetBeans to have the following parameters:

Main Script:  path_to_enlightenment.rb
Working Directory:  C:\rubykoans\koans
(All other options are blank)

When I attempt to run the application, I receive the following error:

path_to_enlightenment.rb class wasn't found in RubyProject1 project.

Below this is a dialog to select the main script, which just says

<No Ruby files found>

My goal is to be able to run the koans from NetBeans, and look at the output window vs. having to work on the projects in NetBeans, and keep a separate command window open and run the project from there.

Any assistance would be greatly appreciated!

I have it running. I set the main script to

path_to_enlightenment.rb

I also took the Koans and created an project from existing sources. I had to do nothing else and it ran.

Congrats, koans would be a nice way to learn the ins and outs of the language.

the path_to_enlightenment.rb file is just a list of require statements (at least when I cloned the project). NetBeans is probably doing some weird IDE stuff assuming a class with the same name as your project. you could try running the rake task as suggested to do in the README file (last I looked there was a menu option somewhere to run rake tasks within the selected project, maybe a right click on the project folder..?), or put this under all the require statements

class RubyProject1
end

opinion: In keeping with enlightenment, ruby culture, and simplicity (aims of the project), you don't need much more than a terminal and vim or notepad++ to work with the koans project. NetBeans may end up being more of a burden than a help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM