简体   繁体   English

不确定为什么我不能运行Rails服务器

[英]Not sure why I can't run my rails server

I'ma front-end developer looking to get a bit more versed in Rails engineering. 我是一位前端开发人员,希望对Rails工程有所了解。 I've worked on a few rails projects in the past and my machine was configured to work on those projects. 过去,我从事过一些Rails项目,而我的机器被配置为可以在那些项目上工作。 However, I'm trying to set up my own rails app and so far I've gotten the new project created in the correct directory, but when I try to run my server "$ rails server" my localhost:3000 port doesn't show anything, and I receive the following error: 但是,我正在尝试建立自己的rails应用程序,到目前为止,我已经在正确的目录中创建了新项目,但是当我尝试运行服务器“ $ rails server”时,我的localhost:3000端口却没有显示任何内容,并且出现以下错误:

Jon-Haddens-MacBook-Pro-2:app jonhadden$ rails server
/Users/jonhadden/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require': iconv will be deprecated in the future, use String#encode instead.
/Users/jonhadden/.rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.3/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  public/images
      exists  public/javascripts
      exists  public/stylesheets
      exists  script/performance
      exists  test/fixtures
      exists  test/functional
      exists  test/integration
      exists  test/performance
      exists  test/unit
      exists  vendor
      exists  vendor/plugins
      exists  tmp/sessions
      exists  tmp/sockets
      exists  tmp/cache
      exists  tmp/pids
   identical  Rakefile
   identical  README
   identical  app/controllers/application_controller.rb
   identical  app/helpers/application_helper.rb
   identical  config/database.yml
   identical  config/routes.rb
   identical  config/locales/en.yml
   identical  config/initializers/backtrace_silencers.rb
   identical  config/initializers/inflections.rb
   identical  config/initializers/mime_types.rb
   identical  config/initializers/new_rails_defaults.rb
overwrite config/initializers/session_store.rb? (enter "h" for help) [Ynaqdh] h
Y - yes, overwrite
n - no, do not overwrite
a - all, overwrite this and all others
q - quit, abort
d - diff, show the differences between the old and the new
h - help, show this help
overwrite config/initializers/session_store.rb? (enter "h" for help) [Ynaqdh] 

Any help would be appreciated. 任何帮助,将不胜感激。

You're using Rails 2, and the commands for that are quite different. 您使用的是Rails 2,其命令完全不同。 rails server will only start a server in Rails 3 and 4, in Rails 2 this will create a new app called 'server'; rails server将仅在Rails 3和4中启动服务器,在Rails 2中将创建一个名为“服务器”的新应用程序; you're looking for rails script/server . 您正在寻找rails script/server

You should really start working with Rails 4 - Rails 2 is no longer supported. 您应该真正开始使用Rails 4-不再支持Rails 2。

Try rails script/server . 尝试使用rails script/server But you should really look into upgrading rails to a newer version. 但是,您应该真正考虑将Rails升级到新版本。

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

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