Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRon Chan
10,987 Points'ruby' is not recognized as an internal or external command, operable program or batch file.
I have downloaded the latest version of Ruby 2.1.5 (x64) and the corresponding development kit on my computer. Followed Jason's instructions for the installer, which includes adding Ruby executables to the PATH. I then extracted the devkit into a new subdirectory called devkit in the Ruby21 folder. But when I ran the ruby dk.rb init in the devkit subdirectory, I got the above message.
On inspecting the environment variables for my account, I see C:\Ruby21-x64\bin has already been specified in the PATH. I am not sure why it isn't running and don't know what I missed out. Appreciate any suggestions on what else I should try to troubleshoot this. I am running Windows 8 on my notebook.
2 Answers
Colin Bell
29,679 PointsAre you typing ruby.dk init
? It should be:
ruby dk.rb init
then
ruby dk.rb install
casthrademosthene
6,275 PointsColin Bell can you please help me also everytime I type jekyll serve, I get this here and I can't connect it to my localhost.. Please help
C:\RubyDevKit\newproject>jekyll serve Configuration file: C:/RubyDevKit/newproject/_config.yml Source: C:/RubyDevKit/newproject Destination: C:/RubyDevKit/newproject/_site Incremental build: disabled. Enable with --incremental Generating... jekyll 3.2.0 | Error: different prefix: "/" and "C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/minima-1.0.1"
Ron Chan
10,987 PointsRon Chan
10,987 PointsI typed ruby dk.rb init in the devkit folder using the command prompt. Thank you for pointing that out the typo in my question. Just edited it.
Colin Bell
29,679 PointsColin Bell
29,679 PointsDo you get the same error when you type something simple like:
ruby -v
Ron Chan
10,987 PointsRon Chan
10,987 PointsYup, same error when I try typing other commands or elsewhere outside the directory.
Colin Bell
29,679 PointsColin Bell
29,679 PointsHmm, my only suggestions would be to either reinstall ruby, making sure to check the "Add Ruby executables" option:
Or try out the second solution listed here
Ron Chan
10,987 PointsRon Chan
10,987 PointsThanks for the link Colin! I tried replacing the PATH user variable in the environment variables with just C:\Ruby21-x64\bin; and it worked. Apparently my old PATH user variable is a very long list that is two pages long! I am guessing the list might be too long or I made some typos in it previously. I don't recommend other students try to change it without keeping a copy of the previous PATH as a backup.
Colin Bell
29,679 PointsColin Bell
29,679 PointsGood deal! Glad you got it working!