eg
For example, when running rails's own server under Linux, this command is required rails_evn=production rails S is not a bit verbose, every time to hit so many words, can not tolerate, fortunately, we have shell script help. Create a script of your own:
Touch a rails_s.sh and then use VIM to edit the following, save.
# !/bin/bash Rails_evn=production Rails S
Execute the following command:
Echo $PATH
The display path information is as follows:
Echo $PATH/home/sophia/.rvm/gems/ruby-2.1. 3/bin:/home/sophia/.rvm/gems/ruby-2.1. 3@global/bin:/home/sophia/.rvm/rubies/ruby-2.1. 3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/ Sophia/.rvm/bin:/home/sophia/.rvm/bin:/home/sophia/.rvm/bin
You can see that there is a/usr/local/bin, put the written rails_s.sh into the/usr/local/bin, and then change the permissions:
sudo chmod 5 rails_s.SH
You can now use rails_s under the project directory (eg:/var/www/blog/) . The sh command executes the script to start the server:
[Email protected]:/var/www/ashelf$ rails_ssh= booting Webrick3.2. A in production on http://0.0.0.0:3000= Call with-D to detach= Ctrl-c to Shutd Own server
Linux shell scripts execute in other directories