开发者

rails does not generate script/server anymore

开发者 https://www.devze.com 2023-03-30 04:01 出处:网络
Just bought a new Macbook Pro and tried to follow this tutorial step by step: http://developer.apple.com/tools/rubyonrails.html

Just bought a new Macbook Pro and tried to follow this tutorial step by step: http://developer.apple.com/tools/rubyonrails.html

The first difference is that now I need to run: rails new expenses --database=mysql to generate a project using mysql, then there is nothing else except "rails" under the script folder. On an older mac I got server, generate and a bunch of other files under script. Is this because of the new version of rails changed the way of doing things? Or I did something wrong?

Can someone point out a new tutorial or help me fix the problem? Here is the rest of running rails new expenses, it does not give any error indication.

Thanks

 $ sudo rails new expenses --database=mysql
  create  
  create  README
  create  Rakefile
  create  config.ru
  create  .gitignore
  create  Gemfile
  create  app
  create  app/controllers/application_controller.rb
  create  a开发者_开发问答pp/helpers/application_helper.rb
  create  app/mailers
  create  app/models
  create  app/views/layouts/application.html.erb
  create  config
  create  config/routes.rb
  create  config/application.rb
  create  config/environment.rb
  create  config/environments
  create  config/environments/development.rb
  create  config/environments/production.rb
  create  config/environments/test.rb
  create  config/initializers
  create  config/initializers/backtrace_silencers.rb
  create  config/initializers/inflections.rb
  create  config/initializers/mime_types.rb
  create  config/initializers/secret_token.rb
  create  config/initializers/session_store.rb
  create  config/locales
  create  config/locales/en.yml
  create  config/boot.rb
  create  config/database.yml
  create  db
  create  db/seeds.rb
  create  doc
  create  doc/README_FOR_APP
  create  lib
  create  lib/tasks
  create  lib/tasks/.gitkeep
  create  log
  create  log/server.log
  create  log/production.log
  create  log/development.log
  create  log/test.log
  create  public
  create  public/404.html
  create  public/422.html
  create  public/500.html
  create  public/favicon.ico
  create  public/index.html
  create  public/robots.txt
  create  public/images
  create  public/images/rails.png
  create  public/stylesheets
  create  public/stylesheets/.gitkeep
  create  public/javascripts
  create  public/javascripts/application.js
  create  public/javascripts/controls.js
  create  public/javascripts/dragdrop.js
  create  public/javascripts/effects.js
  create  public/javascripts/prototype.js
  create  public/javascripts/rails.js
  create  script
  create  script/rails
  create  test
  create  test/fixtures
  create  test/functional
  create  test/integration
  create  test/performance/browsing_test.rb
  create  test/test_helper.rb
  create  test/unit
  create  tmp
  create  tmp/sessions
  create  tmp/sockets
  create  tmp/cache
  create  tmp/pids
  create  vendor/plugins
  create  vendor/plugins/.gitkeep


This behavior has changed in Rails 3.

You need to run rails s to run the rails server.


Wow that tutorial is old. It is looking at Rails 1.0.

I suggest following another guide completely as a lot has probably changed

There is plenty out there to look at

Ruby on Rails Tutorial - A full book free online

Rails Guides - General guides

Railscasts - Screen casts on various subjects


As of Rails 3, all commands except rails under the script directory were removed. And a single rails command comes to rule them all. So now we can use:

rails generate ...
rails server

And we also have short form as these respectively:

rails g ...
rails s

P.S, if you use bundler (you should), prefix commands with bundle exec:

bundle exec rails s
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号