Ubuntu rails git common commands

Source: Internet
Author: User

===========================rails Command =====================================

1. Create controler:welcome; action:index

$ rails Generate Controller Welcome index

2. Create a model definition named article title:string text:text
$ bin/rails Generate model article title:string Text:text
$ bin/rake db:migrate Migrating data

3. Create Model Add Association
$ rails Generate model Comment commenter:string body:text article:references

4. Add a rest action in the file config/routes.rb
Rails.application.routes.draw do
Resources:articles
End

$ bin/rake Routes

5. Go to the console
Rails C

===========================ubuntu Command =====================================

Git add store to local
git commit-m ' message ' When the tag is stored (where it was modified to facilitate the next query)
Git Pul Download server code
git push upload code to server

===========================ubuntu Command =====================================

< a > installation file

I. How to install the Deb package

sudo dpkg-i *.deb


Second, compile the installation method

Building a compilation environment
sudo apt-get install build-essential

To the source code of the compressed document, unzip it into the/tmp directory, enter the/tmp/software directory, and then execute the following three commands:
1./configure 2 make 3 sudo make install

eg
Install dependent packages
0. sudo apt-get install build-essential

1. Unzip
TAR-ZXF nagios-4.0.2.tar.gz
2. Enter the catalogue
CD nagios-4.0.2
3. Configuration
./configure--prefix=/usr/local/nagios
4. Compiling
Make all
5. Installation
Make install && make Install-init && make Install-commandmode && make Install-config

Three, Apt-get installation method

sudo apt-get install software name

< two > Uninstall software

1. Software uninstall: sudo apt-get purge software name
2. Delete package includes configuration file sudo apt-get remove--purge software name
3. Update Source: sudo apt-get update

< four > Delete files

sudo rm-rf folder name

Continuous update ...

Ubuntu rails git common commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.