简体   繁体   English

无法启动Rails Server-'rails s'在现有应用程序内创建一个新的Rails应用程序

[英]Could Not start Rails Server - 'rails s' creates a new rails app inside existing app

I have cloned a Rails Project into my local. 我已经将Rails项目克隆到了我的本地环境中。 I did a rake db:migrate. 我做了一个耙db:migrate。 I worked fine. 我做得很好 Now I want to start my server. 现在,我要启动服务器。 I run the command 我运行命令

rails s

This command actually creates a new project inside the existing app. 该命令实际上在现有应用程序内创建一个新项目。 Why is this happening? 为什么会这样呢?

It throws the following trace and server did not start. 它将引发以下跟踪,并且服务器未启动。

 /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require': iconv will be deprecated in the future, use String#encode instead.
/var/lib/gems/1.9.1/gems/rails-2.3.16/lib/rails_generator/generators/applications/app/app_generator.rb:7: Use RbConfig instead of obsolete and deprecated Config.
  exists  
  exists  app/controllers
  exists  app/helpers
  exists  app/models
  exists  app/views/layouts
  exists  config/environments
  exists  config/initializers
  exists  config/locales
  exists  db
  exists  doc
  exists  lib
  exists  lib/tasks
  exists  log  
  exists  test/fixtures    
  exists  tmp/sockets
  exists  tmp/cache
  exists  tmp/pids
   identical  Rakefile
   identical  README
   identical  app/controllers/application_controller.rb     b
overwrite config/initializers/session_store.rb? (enter "h" for help) [Ynaqdh] y
   force  config/initializers/session_store.rb
overwrite config/initializers/cookie_verification_secret.rb? (enter "h" for help) [Ynaqdh] y  
  identical  script/about
  identical  script/console
  identical  script/dbconsole
  identical  script/destroy
  identical  script/generate   
  identical  public/404.html
  identical  public/422.html
  identical  public/500.html
  identical  public/index.html
  identical  public/favicon.ico
  identical  public/robots.txt
  identical  public/images/rails.png
  identical  public/javascripts/prototype.js
  identical  public/javascripts/effects.js
 identical  public/javascripts/dragdrop.js

Should I change any configuration? 我应该更改任何配置吗?

You must be on older version of rails, Rails version < 3.0. 您必须使用旧版本的Rails,Rails版本<3.0。

In Rails version < 3.0 you have to start server with 在Rails版本<3.0中,您必须使用以下命令启动服务器

ruby script/server

Steps: 脚步:

  1. Clone project. 克隆项目。
  2. Got to inside project directory using console window. 使用控制台窗口转到项目内部目录。
  3. setup database inside config/database.yml 在config / database.yml中设置数据库
  4. run: bundle install 运行:捆绑安装
  5. run: rake db:create 运行:rake db:create
  6. run: rake db:migrate 运行:rake db:migrate
  7. run rails s 滑轨
  8. visit: http://localhost:3000 访问: http:// localhost:3000
  9. Enjoy 请享用

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

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