diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2015-12-18 13:01:05 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2015-12-18 13:01:10 +0100 |
commit | ea4f0e2baba8653b03fba154357842933cf7b778 (patch) | |
tree | 7a3971967cf8c872adb374bd0ab9e7c85ef0ad21 /guides | |
parent | bced489ac788d254329f666f90105cadd7f4d8f5 (diff) | |
download | rails-ea4f0e2baba8653b03fba154357842933cf7b778.tar.gz rails-ea4f0e2baba8653b03fba154357842933cf7b778.tar.bz2 rails-ea4f0e2baba8653b03fba154357842933cf7b778.zip |
Refer to rails command instead of rake in a bunch of places
Still more to do. Please assist!
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/action_controller_overview.md | 2 | ||||
-rw-r--r-- | guides/source/action_mailer_basics.md | 2 | ||||
-rw-r--r-- | guides/source/active_model_basics.md | 2 | ||||
-rw-r--r-- | guides/source/active_record_basics.md | 4 | ||||
-rw-r--r-- | guides/source/active_record_migrations.md | 30 | ||||
-rw-r--r-- | guides/source/api_app.md | 2 | ||||
-rw-r--r-- | guides/source/api_documentation_guidelines.md | 2 | ||||
-rw-r--r-- | guides/source/asset_pipeline.md | 8 |
8 files changed, 26 insertions, 26 deletions
diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md index 6c622a3643..d2e2d27737 100644 --- a/guides/source/action_controller_overview.md +++ b/guides/source/action_controller_overview.md @@ -394,7 +394,7 @@ Rails sets up (for the CookieStore) a secret key used for signing the session da # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. +# You can use `rails secret` to generate a secure secret key. # Make sure the secrets in this file are kept private # if you're sharing your code publicly. diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md index 4800cece82..cd2c13e8c1 100644 --- a/guides/source/action_mailer_basics.md +++ b/guides/source/action_mailer_basics.md @@ -170,7 +170,7 @@ First, let's create a simple `User` scaffold: ```bash $ bin/rails generate scaffold user name email login -$ bin/rake db:migrate +$ bin/rails db:migrate ``` Now that we have a user model to play with, we will just edit the diff --git a/guides/source/active_model_basics.md b/guides/source/active_model_basics.md index 8f8256c983..c05e20aceb 100644 --- a/guides/source/active_model_basics.md +++ b/guides/source/active_model_basics.md @@ -435,7 +435,7 @@ the Active Model API. ``` ```bash -$ rake test +$ rails test Run options: --seed 14596 diff --git a/guides/source/active_record_basics.md b/guides/source/active_record_basics.md index 56f69f8f82..fba89f9d13 100644 --- a/guides/source/active_record_basics.md +++ b/guides/source/active_record_basics.md @@ -369,8 +369,8 @@ end ``` Rails keeps track of which files have been committed to the database and -provides rollback features. To actually create the table, you'd run `rake db:migrate` -and to roll it back, `rake db:rollback`. +provides rollback features. To actually create the table, you'd run `rails db:migrate` +and to roll it back, `rails db:rollback`. Note that the above code is database-agnostic: it will run in MySQL, PostgreSQL, Oracle and others. You can learn more about migrations in the diff --git a/guides/source/active_record_migrations.md b/guides/source/active_record_migrations.md index a8ffa5b378..a4a23395fb 100644 --- a/guides/source/active_record_migrations.md +++ b/guides/source/active_record_migrations.md @@ -720,7 +720,7 @@ Running Migrations Rails provides a set of Rake tasks to run certain sets of migrations. The very first migration related Rake task you will use will probably be -`rake db:migrate`. In its most basic form it just runs the `change` or `up` +`rails db:migrate`. In its most basic form it just runs the `change` or `up` method for all the migrations that have not yet been run. If there are no such migrations, it exits. It will run these migrations in order based on the date of the migration. @@ -734,7 +734,7 @@ is the numerical prefix on the migration's filename. For example, to migrate to version 20080906120000 run: ```bash -$ bin/rake db:migrate VERSION=20080906120000 +$ bin/rails db:migrate VERSION=20080906120000 ``` If version 20080906120000 is greater than the current version (i.e., it is @@ -751,7 +751,7 @@ mistake in it and wish to correct it. Rather than tracking down the version number associated with the previous migration you can run: ```bash -$ bin/rake db:rollback +$ bin/rails db:rollback ``` This will rollback the latest migration, either by reverting the `change` @@ -759,7 +759,7 @@ method or by running the `down` method. If you need to undo several migrations you can provide a `STEP` parameter: ```bash -$ bin/rake db:rollback STEP=3 +$ bin/rails db:rollback STEP=3 ``` will revert the last 3 migrations. @@ -769,7 +769,7 @@ back up again. As with the `db:rollback` task, you can use the `STEP` parameter if you need to go more than one version back, for example: ```bash -$ bin/rake db:migrate:redo STEP=3 +$ bin/rails db:migrate:redo STEP=3 ``` Neither of these Rake tasks do anything you could not do with `db:migrate`. They @@ -778,17 +778,17 @@ version to migrate to. ### Setup the Database -The `rake db:setup` task will create the database, load the schema and initialize +The `rails db:setup` task will create the database, load the schema and initialize it with the seed data. ### Resetting the Database -The `rake db:reset` task will drop the database and set it up again. This is +The `rails db:reset` task will drop the database and set it up again. This is functionally equivalent to `rake db:drop db:setup`. NOTE: This is not the same as running all the migrations. It will only use the contents of the current `db/schema.rb` or `db/structure.sql` file. If a migration can't be rolled back, -`rake db:reset` may not help you. To find out more about dumping the schema see +`rails db:reset` may not help you. To find out more about dumping the schema see [Schema Dumping and You](#schema-dumping-and-you) section. ### Running Specific Migrations @@ -799,7 +799,7 @@ the corresponding migration will have its `change`, `up` or `down` method invoked, for example: ```bash -$ bin/rake db:migrate:up VERSION=20080906120000 +$ bin/rails db:migrate:up VERSION=20080906120000 ``` will run the 20080906120000 migration by running the `change` method (or the @@ -815,7 +815,7 @@ To run migrations against another environment you can specify it using the migrations against the `test` environment you could run: ```bash -$ bin/rake db:migrate RAILS_ENV=test +$ bin/rails db:migrate RAILS_ENV=test ``` ### Changing the Output of Running Migrations @@ -876,7 +876,7 @@ generates the following output == CreateProducts: migrated (10.0054s) ======================================= ``` -If you want Active Record to not output anything, then running `rake db:migrate +If you want Active Record to not output anything, then running `rails db:migrate VERBOSE=false` will suppress all output. Changing Existing Migrations @@ -885,9 +885,9 @@ Changing Existing Migrations Occasionally you will make a mistake when writing a migration. If you have already run the migration then you cannot just edit the migration and run the migration again: Rails thinks it has already run the migration and so will do -nothing when you run `rake db:migrate`. You must rollback the migration (for +nothing when you run `rails db:migrate`. You must rollback the migration (for example with `rake db:rollback`), edit your migration and then run -`rake db:migrate` to run the corrected version. +`rails db:migrate` to run the corrected version. In general, editing existing migrations is not a good idea. You will be creating extra work for yourself and your co-workers and cause major headaches @@ -969,7 +969,7 @@ this, then you should set the schema format to `:sql`. Instead of using Active Record's schema dumper, the database's structure will be dumped using a tool specific to the database (via the `db:structure:dump` -Rake task) into `db/structure.sql`. For example, for PostgreSQL, the `pg_dump` +rails task) into `db/structure.sql`. For example, for PostgreSQL, the `pg_dump` utility is used. For MySQL, this file will contain the output of `SHOW CREATE TABLE` for the various tables. @@ -1032,7 +1032,7 @@ To add initial data after a database is created, Rails has a built-in 'seeds' feature that makes the process quick and easy. This is especially useful when reloading the database frequently in development and test environments. It's easy to get started with this feature: just fill up `db/seeds.rb` with some -Ruby code, and run `rake db:seed`: +Ruby code, and run `rails db:seed`: ```ruby 5.times do |i| diff --git a/guides/source/api_app.md b/guides/source/api_app.md index 17695c5db0..86baa9ee84 100644 --- a/guides/source/api_app.md +++ b/guides/source/api_app.md @@ -216,7 +216,7 @@ building, and make sense in an API-only Rails application. You can get a list of all middlewares in your application via: ```bash -$ rake middleware +$ rails middleware ``` ### Using the Cache Middleware diff --git a/guides/source/api_documentation_guidelines.md b/guides/source/api_documentation_guidelines.md index 73e62eb6d9..cd208c2e13 100644 --- a/guides/source/api_documentation_guidelines.md +++ b/guides/source/api_documentation_guidelines.md @@ -20,7 +20,7 @@ The [Rails API documentation](http://api.rubyonrails.org) is generated with in the rails root directory, run `bundle install` and execute: ```bash - bundle exec rake rdoc + ./bin/rails rdoc ``` Resulting HTML files can be found in the ./doc/rdoc directory. diff --git a/guides/source/asset_pipeline.md b/guides/source/asset_pipeline.md index 0f2283318a..0083fc0e6c 100644 --- a/guides/source/asset_pipeline.md +++ b/guides/source/asset_pipeline.md @@ -676,7 +676,7 @@ content changes. ### Precompiling Assets -Rails comes bundled with a rake task to compile the asset manifests and other +Rails comes bundled with a task to compile the asset manifests and other files in the pipeline. Compiled assets are written to the location specified in `config.assets.prefix`. @@ -686,10 +686,10 @@ You can call this task on the server during deployment to create compiled versions of your assets directly on the server. See the next section for information on compiling locally. -The rake task is: +The task is: ```bash -$ RAILS_ENV=production bin/rake assets:precompile +$ RAILS_ENV=production bin/rails assets:precompile ``` Capistrano (v2.15.1 and above) includes a recipe to handle this in deployment. @@ -731,7 +731,7 @@ Rails.application.config.assets.precompile += ['admin.js', 'admin.css', 'swfObje NOTE. Always specify an expected compiled filename that ends with .js or .css, even if you want to add Sass or CoffeeScript files to the precompile array. -The rake task also generates a `manifest-md5hash.json` that contains a list with +The task also generates a `manifest-md5hash.json` that contains a list with all your assets and their respective fingerprints. This is used by the Rails helper methods to avoid handing the mapping requests back to Sprockets. A typical manifest file looks like: |