简体   繁体   中英

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. I've worked on a few rails projects in the past and my machine was configured to work on those projects. 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:

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 server will only start a server in Rails 3 and 4, in Rails 2 this will create a new app called 'server'; you're looking for rails script/server .

You should really start working with Rails 4 - Rails 2 is no longer supported.

Try rails script/server . But you should really look into upgrading rails to a newer version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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