简体   繁体   English

无法启动Rails

[英]Can't start Rails

I updated Rails and Ruby: 我更新了Rails和Ruby:

$ ruby -v
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]
$ rails -v
Rails 4.1.8

Now when I execute rails server I get this: 现在,当我执行rails server我得到了:

$ rails server
Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                   # Path to the Ruby binary of your choice
                                                      # Default: /Users/guilherme/.rbenv/versions/2.1.5/bin/ruby
  -m, [--template=TEMPLATE]                           # Path to some application template (can be a filesystem path or URL)
  [--skip-gemfile], [--no-skip-gemfile]               # Don't create a Gemfile
  -B, [--skip-bundle], [--no-skip-bundle]             # Don't run bundle install
  { ... }

What I have to do to start Rails? 我必须做些什么来启动Rails?

You can not start the Rails server unless you're in your project directory. 除非您在项目目录中,否则无法启动Rails服务器。

Suppose if you're working on myapp project. 假设您正在处理myapp项目。 You've to move to that project directory on your command line and then run the Rails server. 您必须在命令行上移至该项目目录,然后运行Rails服务器。

Example: Assuming you didn't create the Rails app yet: 示例:假设您尚未创建Rails应用程序:

$> rails new myapp
$> cd myapp

Now start the Rails server with either of these two commands: 现在,使用以下两个命令之一启动Rails服务器:

$> rails server

or: 要么:

$> rails s

您应该先进入Rails项目目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM