mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use -e
option to specify the environment in console command [ci skip]
Passing the environment's name as a regular argument is deprecated
in 48b2499273
.
This commit is contained in:
parent
8c7967c9b9
commit
07ec810ac0
2 changed files with 2 additions and 2 deletions
|
@ -290,7 +290,7 @@ INFO: You can also use the alias "c" to invoke the console: `rails c`.
|
|||
You can specify the environment in which the `console` command should operate.
|
||||
|
||||
```bash
|
||||
$ bin/rails console staging
|
||||
$ bin/rails console -e staging
|
||||
```
|
||||
|
||||
If you wish to test out some code without changing any data, you can do that by invoking `rails console --sandbox`.
|
||||
|
|
|
@ -973,7 +973,7 @@ By default Rails ships with three environments: "development", "test", and "prod
|
|||
|
||||
Imagine you have a server which mirrors the production environment but is only used for testing. Such a server is commonly called a "staging server". To define an environment called "staging" for this server, just create a file called `config/environments/staging.rb`. Please use the contents of any existing file in `config/environments` as a starting point and make the necessary changes from there.
|
||||
|
||||
That environment is no different than the default ones, start a server with `rails server -e staging`, a console with `rails console staging`, `Rails.env.staging?` works, etc.
|
||||
That environment is no different than the default ones, start a server with `rails server -e staging`, a console with `rails console -e staging`, `Rails.env.staging?` works, etc.
|
||||
|
||||
|
||||
### Deploy to a subdirectory (relative url root)
|
||||
|
|
Loading…
Reference in a new issue