SapphireSteel Forum
Welcome, Guest. Please login or register.
June 18, 2013, 06:33:25 PM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Sapphire and Amethyst IDEs
3893 Posts in 803 Topics by 672 Members
Latest Member: davib
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Sapphire / Ruby In Steel
| | |-+  beta can't find a "required" file
« previous next »
Pages: [1] Print
Author Topic: beta can't find a "required" file  (Read 2530 times)
amiracam
Jr. Member
**
Posts: 69


« on: May 02, 2011, 03:09:58 PM »

I'm back playing with RIS , checking out the file i/o and in particular from the RubyBook project copy_files.rb where a "require" statement specifies a particular core Ruby file i.e.

require( "fileutils" )

RIS can't find it.

I have setup the Ruby path to the Ruby 1.9.2 vm, apparently the tool does not know how to figure the relative path to the core libs from there.

What do I have to do? Are there any docs that cover the VS aspects of RIS ?

thanks in advance,

-Charles
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #1 on: May 02, 2011, 03:35:47 PM »

With Ruby 1.9 you need to add the directory specification (e.g. current dir is ".") so try:

require( "./fileutils" )
Logged
amiracam
Jr. Member
**
Posts: 69


« Reply #2 on: May 02, 2011, 03:54:32 PM »

doesn't the vm or tool have the sense of the location(s) for the core libs? anyhow, that did not work, I imported the project into Ris 2.0 beta i.e. the entire RubyBook project so it would seem then that none of the examples rb files that use "require" will work.
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #3 on: May 02, 2011, 04:06:25 PM »

Sorry, I thought you were referring to a file in the current directory. All The Book Of Ruby programs have been tested with Ruby 1.9 by myself and a batch of editors and reviewers over the last 6 months in preparation for the 2nd edition of The Book Of Ruby from No Starch Press http://www.nostarch.com/boruby.htm and they all work with very few changes (mainly to do with blocks and symbols); there is no fundamental incompatibility re. 'require'. You may want to verify that your system path is set up to the Ruby 1.9 directory. Otherwise, the only important difference with Ruby 1.9 require is the one I mentioned before to reference files in the current directory.

Logged
amiracam
Jr. Member
**
Posts: 69


« Reply #4 on: May 02, 2011, 04:19:35 PM »

ok, well, with RIS 1.0 I did not have to do a thing and it works fine. What do I have to do to actually setup the system path to point to 1.9 ? I did tell the project where the 1.9 vm is? so you would think the tool would change the lib paths accordingly. But pls do tell me how do I setup the system path I guess this an environ var type of thing then i.e. in Windows ?

thanks
Logged
amiracam
Jr. Member
**
Posts: 69


« Reply #5 on: May 02, 2011, 05:09:36 PM »

well, I went ahead and added Ruby 1.92 to the Windows path and it did not work. BTW, Ruby 1.86 was already there.
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #6 on: May 03, 2011, 03:57:45 AM »

Can you run this from the command prompt?
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #7 on: May 03, 2011, 04:25:26 AM »

We are working towards the next Ruby In Steel beta currently so we'll look at this problem in more detail today and get back shortly.

Huw
Logged
amiracam
Jr. Member
**
Posts: 69


« Reply #8 on: May 03, 2011, 07:14:46 AM »

Can you run this from the command prompt?

i.e. try to run the .rb file in question , I have not tried. I'm assuming you mean just trigger it i.e. just call it from a command prompt. If that's the case I can do the experiment.
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #9 on: May 03, 2011, 09:35:47 AM »

right click solution explorer, open command prompt in the correct directory run
Code:
ruby <filename>
Logged
amiracam
Jr. Member
**
Posts: 69


« Reply #10 on: May 03, 2011, 10:42:47 AM »

I'll have to check this out tomorrow when I'm back at the office since for some reason I can't do a project import into Ris2.0 beta of the RubyBook solution. I was however, able to do so at my other pc , btw, both are Win7 64 , one's a Pro and the other Home Premium
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!