简体   繁体   中英

deploying 2 rails application on ec2

i'm using Ubuntu 16.04 and installed docker on my machine and created 2 Hello World ruby on rails web application images.

The first one say "Hello World" , and the second say "Howdy World" .
Ran both containers in parallel on my local machine, on different ports using the localhost.

Created a free AWS account, set up a VPC with a public subnet and spine up an EC2 instance with a public security group and created the relevant ssh credentials.

When I try to deploy the images to GitHub by pushing, the first one pushed fine, then second one however doesn't seems to work because I keep getting this

error
Updates were rejected because the tip of your current branch is behind it's remote counterpart. integrate the remote changes (git pull...) before pushing again

after that I need to somehow run these 2 applications on the EC2 machine (succeeded in connecting to the machine via Ubuntu terminal but got stuck since then) so I could give it a public IP and with it's port, to and see them from any device that I connect.

Any help will be appreciated ?

If the two applications are different repos on your local machine, you cannot push them to the same GitHub repository (hence the error about your branch being behind the remote because the histories are unrelated).

You should create a new GitHub repository and push to it instead.

You can resolve by two methods

Method 1 --> So, in that case, you need to push your content forcefully. run below command

git push -f origin (branch name )

Method 2 --> first you need to update your local repo (it's in the case of using single repo for all files)

git pull 

then push your content without using -f (forcefully)

git push origin (branch name)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM