无法启动 Rails [英] Can't start Rails
本文介绍了无法启动 Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我更新了 Rails 和 Ruby:
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
现在当我执行 rails server
我得到这个:
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
{ ... }
我必须做什么才能启动 Rails?
What I have to do to start Rails?
推荐答案
除非您在项目目录中,否则无法启动 Rails 服务器.
You can not start the Rails server unless you're in your project directory.
假设您正在处理 myapp 项目.您必须在命令行上移动到该项目目录,然后运行 Rails 服务器.
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.
示例:假设您尚未创建 Rails 应用程序:
Example: Assuming you didn't create the Rails app yet:
$> rails new myapp
$> cd myapp
现在使用以下两个命令之一启动 Rails 服务器:
Now start the Rails server with either of these two commands:
$> rails server
或:
$> rails s
这篇关于无法启动 Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文