不知道为什么我不能运行我的rails服务器

时间:2014-03-07 00:18:05

标签: ruby-on-rails ruby

我是一名前端开发人员,希望在Rails工程方面有所了解。我过去曾参与过几个rails项目,我的机器配置为可以处理这些项目。但是,我正在尝试设置我自己的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] 

任何帮助都将不胜感激。

2 个答案:

答案 0 :(得分:1)

你正在使用Rails 2,它的命令是完全不同的。 rails server只会在Rails 3和4中启动服务器,在Rails 2中,这将创建一个名为“server”的新应用程序;你正在寻找rails script/server

你应该真正开始使用Rails 4 - 不再支持Rails 2。

答案 1 :(得分:0)

试试rails script/server。但是你应该真正考虑将rails升级到更新的版本。