2014年5月2日 星期五

rails command line

  • rails console
  • rails server
  • rake
  • rails generate
  • rails dbconsole
  • rails new app_name
$ rails console --sandbox

$ rails destroy model Oops
$ rake about


You can precompile the assets in app/assets using rake assets:precompile and remove those compiled assets using rake assets:clean.
rake routes


rails foo

Creates a new Rails applications in subdirectory foo.
rake db:migrate
Runs all migrations to bring the database up to date.
rake db:migrate:reset
Drops the database, creates a new one, and runs all migrations to bring the database up to date.
rake db:migrate VERSION=20090909201633_create_photos.rb
Runs migrations (either forward or backward) to restore the database to match the state just after the given migration.
gem update
Updates all Ruby Gems.
gem update rails--include-dependencies
Updates Rails to the latest version, including all Gems that Rails depends upon.
gem update --system
Updates Ruby to the latest version.


bundle exec gem uninstall GEM_NAME

---------using bundle

undle clean(1)
Cleans up unused gems in your bundler directory
bundle show(1)
Show the source location of a particular gem in the bundle


bundle install(1)
Install the gems specified by the Gemfile or Gemfile.lock
bundle update(1)
Update dependencies to their latest versions

沒有留言:

張貼留言