IMHO, that's actually one of the best things about Ruby -- the
*community*. I don't think I've seen such warm welcoming and
willingness to help, in the community of any other language. (And
this from the guy who, at the other extreme, owns the LinkedIn Plain
Old C programming group!)
-Dave
···
On Fri, Nov 18, 2011 at 22:58, Otto Dydakt <ottodydakt@yahoo.com> wrote:
Wow I shouldn't be this happy about programming on a friday night but
you guys are AWESOME. Thank you so much.
--
LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages.
Where: Northern Virginia, Washington DC (near Orange Line), and remote work.
See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence).
Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson)
I'll send a note to the publisher of this "Learn to Program" book. They
should totally have that in there.
RubyInstaller creates two shortcuts inside the Start menu:
"Interactive Ruby" (also known as IRB)
And "Start Command Prompt with Ruby"
The first one is where the book should be referring to.
The second one is a command line (cmd.exe) where Ruby-related commands
can be executed, like "gem install" and others in case you didn't add
Ruby to your PATH.
I have a similar problem, but the solutions discussed here don't seem to
be working for me. Actually I have two problems, but am sure they are
related to the same issue.
If I start the command prompt by clicking on "start command prompt with
Ruby", then Ruby commands are available; i.e., I can type "ruby
helloworld.rb" (where helloworld.rb is a file I have created) and it
will execute the code. However, if I go to the command prompt using
start menu and typing "cmd", it does not respond to "irb", "ruby -v",
"ruby helloworld.rb", etc.
The attached screenshot shows the problem, with top left showing the cmd
prompt with Ruby, and the bottom left showing the normal cmd prompt
(giving the error "ruby is not recognized as an internal or external
command, operable program or batch file"). I reinstalled twice, making
sure I check the 3 check boxes during installation, but still have the
same problem.
Additionally, if I use SciTE to try to run a program called
"helloworld.rb", it gives me the error "the system cannot find the file
specified". Again, shown on the screenshot, right side.
I have a similar problem, but the solutions discussed here don't seem to
be working for me. Actually I have two problems, but am sure they are
related to the same issue.
If I start the command prompt by clicking on "start command prompt with
Ruby", then Ruby commands are available; i.e., I can type "ruby
helloworld.rb" (where helloworld.rb is a file I have created) and it
will execute the code. However, if I go to the command prompt using
start menu and typing "cmd", it does not respond to "irb", "ruby -v",
"ruby helloworld.rb", etc.
There is an option in the installer to make Ruby and other Ruby provided
executables available in your PATH.
It is called "Add Ruby executables to your PATH".
And by default is unchecked to avoid it interfere with other Ruby
installations in your system.
You can start the installer again, select that option and will require
closing and starting both the command prompts and the editors so they
get the PATH changes.
There is an option in the installer to make Ruby and other Ruby provided
executables available in your PATH.
It is called "Add Ruby executables to your PATH".
And by default is unchecked to avoid it interfere with other Ruby
installations in your system.
You can start the installer again, select that option and will require
closing and starting both the command prompts and the editors so they
get the PATH changes.
--
Luis Lavena
Thanks Luis for the response.
I have reinstalled a couple of times now, making sure the option was
checked at the time of installation. Restarting after each uninstall and
reinstall. Still doesn't work.
Is it possible that the problem has to do with the permissions I have on
my machine (I am using my work machine, on which I have limited rights).
It is letting me install Ruby without raising errors though.
I have reinstalled a couple of times now, making sure the option was
checked at the time of installation. Restarting after each uninstall and
reinstall. Still doesn't work.
Are you talking about a fresh command prompt *after* you installed?
And provide the more information about your environment, environment
variables (like PATH, HOME, etc) and other details for the guys be able
to help you.
Is it possible that the problem has to do with the permissions I have on
my machine (I am using my work machine, on which I have limited rights).
It is letting me install Ruby without raising errors though.
RubyInstaller works good in both admin and non-admin set of permissions
so it can work under limited rights without issues.
Have you tried manually editing the path variable?
Does that work?
What OS are you using?
On WinXP Right click on My computer
Choose "Advanced" tab
Then "Environmental variables"
In the "system variables" list list click on path.
You can view the path variable and you may be able to Edit it from there to
add "C:\Ruby193\bin" , just don't change the current ones or you may break
other things.
But I am guessing you probably don't have access to change it as it says
"You must be logged on as a member of the administrators group to change
change values"
You maybe able to Create a new User variable that will only work for your
account.
In the top group (user variables for {accountName}) Try creating a new
variable called "Path" and put "C:\Ruby193\bin" as the value.
That should be appended to the System environment path variable, only for
your account.
I hope this works for you, sorry if I am leading you astray.
OK, so have you checked the option that I mentioned before during the
installer?
Add Ruby executables to the PATH
Have you started another command prompt after that?
Yes to all
After you install and check that box again, can you open a new command
prompt and execute the following?
C:\Users\Luis>REG QUERY "HKCU\Environment"
You should see a key in the output like this:
PATH REG_EXPAND_SZ ...
What is the output in your case?
There was no PATH in the output. However, I followed the steps in
Jaxxa's response, created a user variable PATH, and that seems to have
sorted things!
You maybe able to Create a new User variable that will only work for
your
account.
In the top group (user variables for {accountName}) Try creating a new
variable called "Path" and put "C:\Ruby193\bin" as the value.
That should be appended to the System environment path variable, only
for
your account.
There was no PATH in the output. However, I followed the steps in
Jaxxa's response, created a user variable PATH, and that seems to have
sorted things!
Awesome to hear!
For some reason the installer was not adding the environment variable
for your user, which is weird since you executed as normal user and not
elevated.
I'm creating a ticket to update our wiki with instructions for this
scenario, so the knowledge obtained and shared by Joshua (jaxxa) is
accessible.