开发者

Ruby on Rails -- new install on windows 7 but cant run ruby commands, problem with path?

开发者 https://www.devze.com 2023-01-21 20:13 出处:网络
I just installed ruby on rails on my new computer ( I was using instantrails before) and I\'m trying to get everything setup.

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?

开发者_如何学Python

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


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.


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?


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 :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号