Can't start Rails

最后都变了- 提交于 2019-12-25 01:07:46

问题


I updated Rails and 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
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?


回答1:


You can not start the Rails server unless you're in your project directory.

Suppose if you're working on myapp project. You've to move to that project directory on your command line and then run the Rails server.

Example: Assuming you didn't create the Rails app yet:

$> rails new myapp
$> cd myapp

Now start the Rails server with either of these two commands:

$> rails server

or:

$> rails s



回答2:


You should go to your Rails project directory first



来源:https://stackoverflow.com/questions/27445088/cant-start-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!