views:

32

answers:

3

I just installed ruby on rails on my new computer ( I was using instantrails before) and I'm trying to get everything setup.

Im running Windows 7. So I followed the instructions from this tutorial.

http://blogupstairs.com/ruby-on-rails/installing-ruby-on-rails-on-windows-7/

The problem i'm guessing is step 3

"Add the newly installed bin directory to your path in your windows system : Open windows explorer-> right click the icon computer-> choose Properties -> in the contol panel Home, Click Advanced system settings and then click Envitonment Variables button->in the system variables click new and add new system variables like this : Variable name : RUBY_HOME , Variable Value : C:\Ruby, after that add it in to the path and add the bin after a semicolon to the “Path” variable like this : C:\Program Files\Common Files\Adobe\AGL;%JAVA_HOME%\bin;%ANDROID_HOME%\tools;%RUBY_HOME%\bin"

I set created the system variables but when I try to run script/generate in the main directory of my app I get the error

"Ruby: no such file or directory --script/generate"

I checked the apps directory and the script folder is in there. How can I run the "ruby script/generate" commands from the control panel?

I was guessing it was something with the path but I dont know any ways to check to find out whats going wrong.

+1  A: 

In 99.99999% of all cases, if a computer tells you that it cannot find a file at a specific location, it is because that file is not at that specific location.

So, is there actually a file named generate in a directory named script in the current directory?

Jörg W Mittag
+3  A: 

Are you using Rails 3.0+? In this version of rails and up, the script/* folder has been deprecated in favor of rails generate, rails server, etc. See here.

nuclearsandwich
Yeah, I'm pretty sure `gem install rails` now installs 3 by default, so the tutorial is a bit out of date. You can double check with `gem list rails`.
Isaac Cambron
A: 

Hi, I have recently installed RoR on my "clean" Win7 as well.

What IDE are you using?

I suggest trying JRuby with NetBeans/RubyMine:

  • JRuby installer does all the work (even adds the proper variables to your path in system environment settings...,
  • IDEs take care of gems, setting up servers etc.

As for the commands, as Nuclearsandwitch mentioned, there is no script/generate or script/server in Rails 3. Just make sure you in the directory with your Rails app and then try running rails server. It should work :-)

Petr Havlík