简体   繁体   English

无法在Windows中启动Rails Server

[英]Can't Start Rails Server in Windows

I am newbie in ruby on rails. 我是红宝石的新手。 I'm currently installing Ruby on Rails. 我目前正在安装Ruby on Rails。 I've done all the steps until : bundle install . 我已经完成所有步骤,直到: bundle install Then i type rails server to start the rails server. 然后,我键入rails server以启动rails服务器。 From what I read in http://guides.rubyonrails.org/command_line.html , after i type rails server , it's supposed to show: 从我在http://guides.rubyonrails.org/command_line.html中阅读的内容中,我键入rails server ,应该显示:

$ cd commandsapp
$ bin/rails server
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-08-07 02:00:01] INFO  WEBrick 1.3.1
[2013-08-07 02:00:01] INFO  ruby 2.0.0 (2013-06-27) [x86_64-darwin11.2.0]
[2013-08-07 02:00:01] INFO  WEBrick::HTTPServer#start: pid=69680 port=3000

but in my Command Line it show this, instead: 但是在我的命令行中却显示了这个: 在此处输入图片说明

So the rails server is not running and when i type localhost:3000 or localhost:8000 in the browser, it says unable to connect(probably because the server isn't running). 因此,Rails服务器未运行,并且当我在浏览器中键入localhost:3000localhost:8000时,它说无法连接(可能是因为服务器未运行)。

Sorry my bad language. 对不起,我的语言不好。

You need to create a rails app and change into that directory before you can run the server. 您需要先创建一个Rails应用程序并切换到该目录,然后才能运行服务器。 Try this: 尝试这个:

rails new commandsapp    # the name can be anything you want
cd commandsapp
rails server

"rails new " creates a new folder with the default rails layout (app, db, log etc). “ rails new”使用默认的rails布局(应用程序,数据库,日志等)创建一个新文件夹。

The Error: 'require' : cannot load such file -- sqlite3/sqlite3_native (LoadError) ==> You must insert gem sqlite3/sqlite3_native into gemfile, then bundle install again. 错误:'require':无法加载此类文件-sqlite3 / sqlite3_native(LoadError)==>必须将gem sqlite3 / sqlite3_native插入gemfile,然后再次捆绑安装。 Try with rails server. 尝试使用Rails服务器。

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

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