Ruby on Rails - 不创建脚本/服务器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5661554/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 00:56:04  来源:igfitidea点击:

Ruby on Rails - Doesn't create script/server

ruby-on-railsruby

提问by ryryan

I have been trying for two days to install Ruby on Rails on windows xp (I am a noob at RoR, first time using it).

我已经尝试了两天在 windows xp 上安装 Ruby on Rails(我是 RoR 的菜鸟,第一次使用它)。

I am reading some tutorials online how to install it. I have installed Ruby, installed Mysql and installed Rails by gem install rails.

我正在在线阅读一些教程如何安装它。我已经安装了 Ruby,安装了 Mysql 并通过gem install rails.

Now when I create a new app by rails new myappthen cd myappand then ruby script/server, it says:

现在,当我通过创建一个新的应用程序rails new myapp,然后cd myapp,然后ruby script/server,它说:

ruby: No such file or directory -- script/server (LoadError)

ruby:没有这样的文件或目录——脚本/服务器(加载错误)

In the script directory there is no 'server' file, there is only a rails file.

在脚本目录中没有“服务器”文件,只有一个 rails 文件。

I have followed the tutorial correctly and have double checked I and creating the app correctly. This is the tutorial link: http://allaboutruby.wordpress.com/2006/01/09/installing-rails-on-windows-step-by-step-tutorial/

我正确地遵循了教程,并仔细检查了我并正确创建了应用程序。这是教程链接:http: //allaboutruby.wordpress.com/2006/01/09/installing-rails-on-windows-step-by-step-tutorial/

回答by John Beynon

If you've done gem install rails then it will have grabbed v3.0.6 rails which changed (at v3) to use rails serverto start the server.

如果你已经完成 gem install rails ,那么它会抓取 v3.0.6 rails,它改变了(在 v3 时)rails server用于启动服务器。

回答by Matteo Alessani

If you're using Rails 3 you need to use:

如果您使用的是 Rails 3,则需要使用:

rails server

回答by Tufail

you can use in new ruby ...installtion

您可以在新的 ruby​​ ...安装中使用

in command prompt

在命令提示符中

c:\ruby\bin>rails new filename

c:\ruby\bin>rails 新文件名

where filename is your new project name to create a new ruby project. and don't use the reserved ruby reseverd word like test

其中 filename 是用于创建新 ruby​​ 项目的新项目名称。并且不要使用像 test 这样保留的 ruby​​ reseverd 词

回答by denisjacquemin

Your tutorial is very old 2006...

你的教程是很老的 2006 年...

You should definitly check railsinstaller.org/to use rails on windows

您应该明确检查railsinstaller.org/以在 Windows 上使用 rails

I am a noob at RoR, first time using it

我是 RoR 的菜鸟,第一次使用它

here is a good documentation guides.rubyonrails.org/

这是一个很好的文档guides.rubyonrails.org/

and you should play with railsforzombies.org/

你应该玩railsforzombies.org/

welcome,

欢迎,

cheers

干杯

回答by Kelvin

From your app directory, run

从您的应用程序目录中,运行

ruby script/rails server

This should work even on Windows.

即使在 Windows 上,这也应该有效。

回答by Someth Victory

You can either use shortcut:

您可以使用快捷方式:

rails s

rails s

回答by Wukerplank

I guess you are using Rails 3, so the proper command is ruby rails server.

我猜你正在使用 Rails 3,所以正确的命令是ruby rails server.

回答by Alan Rezende

Kelvin, congratulations, this command works exactly as you described in windows 8. hugs...

开尔文,恭喜,此命令完全按照您在 Windows 8 中描述的方式工作。拥抱...

ruby script / rails server

回答by Guruprasad

If everything is properly installed and rails is 4.0then the commandis

如果一切都正确安装,rails is 4.0那么命令

user@sony-vaio:~/sample_rails/myApp$ rails server

user@sony-vaio:~/sample_rails/myApp$ rails server

回答by Amirzie Zainal

You can try

你可以试试

bundle exec rails server webrick -e production