Tuesday, 9 July 2019

install PostgreSQL // error

  1. create a Project folder
  2. for ssh key generate use this command=> ssh-keygen
  3. add this key=> ssh-add
  4. Next, clone a project in Project folder use this cmd=>   
               git clone git@bitbucket.org:arvindkushwah9/igb_website.git
               cat /home/bittern/.ssh/id_rsa.pub
               cat ~/.ssh/id_rsa.pub
    5. run bundle install cmd
    6. gem install bundler
    7. When create a error for authentication  /var/lib/gems then use this cmd 
           sudo chmod -R 777 /var/lib/gems
    8. When create a error /usr/local/bin use this cmd=>
           sudo chmod -R 777 /usr/local/bin
    9. when occur a nokogiri error => gem install nokogiri

How to dump database with the help of this cmd =>
               pg_restore --verbose --clean --no-acl --no-owner -h localhost -U root -d mfindex_development latest.dump.7

1. ssh-keygen
2.ssh-add
   Permissions 0664 for '/home/bittern/.ssh/id_rsa' are too open.
   It is required that your private key files are NOT accessible by others.
   This private key will be ignored.
3. chmod 400 ~/.ssh/id_rsa
4. git clone git@github.com:ACATHONLLC/MFIndex.git

  error=>         You must use Bundler 2 or greater with this lockfile.  the use all these cmd=>
update Rubygems => gem update --system
update bundler=> gem install bundler
update gemfile.lock in your project => bundler update --bundler

5. then use this cmd bundle
6. rake db:create
7. How to dump database with the help of this cmd =>
               pg_restore --verbose --clean --no-acl --no-owner -h localhost -U root -d mfindex_development latest.dump.7




   How to install postgresql Database in rails
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"

wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev



sudo service postgresql restart

sudo -u postgres createuser root -s
sudo -u postgres psql
postgres=# \password  root 
 
10. then create a database=> rake db:create
11. psql -U root igb_dev < itgetsbrighter_net_29_05_2018.sql(after create a db)
13. when occur this error psql: FATAL:  Peer authentication failed for user "root" so follow these steps:-
     locate pg_hba.conf to open file

      sudo nano /etc/postgresql/9.5/main/pg_hba.conf(write file name)

      local   all             postgres                                md5

      local   all             root                                        md5
           and change all peer to md5
sudo service postgresql restart

To import database in our project

mysql -u root -p chumaround_dev11 < snaprent_17_05_2019.sql
psql -U root igb_website_02 < itgetsbrighter_net_29_05_2018.sql

14. next, run cmd rails s 
  when occur a error =>
(`validate_options': Missing required arguments: aws_access_key_id,aws_secret_access_key (ArgumentError))
15. Then create a application.yml in config folder and add.


config/Application.yml
      
 default:
   DATABASE_ADAPTER: postgresql
   DATABASE_USER: root
   DATABASE_PASSWORD: root
   DATABASE_NAME: igb_website_02
   DATABASE_HOST: localhost
   DOMAIN: localhost
   AWS_ACCESS_KEY_ID: AKIAIBP3UKKWLGXTJYHA
   AWS_SECRET_ACCESS_KEY: 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
   REGION: 'us-west-2'
   AWS_BUCKET_NAME: its-get-brighter-staging
   FACEBOOK_APP_ID: 4545544757845412155
   FACEBOOK_APP_SERCRET: 4454455451454544545454
   FACEBOOK_APP_VERSION: 'v2.8'

development:
   DATABASE_ADAPTER: postgresql
   DATABASE_USER: root
   DATABASE_PASSWORD: root
   DATABASE_NAME: igb_website_02
   DATABASE_HOST: localhost
   DOMAIN: localhost
   AWS_ACCESS_KEY_ID: AKIAIBP3UKKWLGXTJYHA
   AWS_SECRET_ACCESS_KEY: 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
   REGION: 'us-west-2'
   AWS_BUCKET_NAME: its-get-brighter-staging
   FACEBOOK_APP_ID: 4545544757845412155
   FACEBOOK_APP_SERCRET: 4454455451454544545454
   FACEBOOK_APP_VERSION: 'v2.8'
   TWITTER_CONSUMER_KEY: bXFWp9nwoKRZ4oiJZ4FtpMNhB
   TWITTER_CONSUMER_SECRET:
xBysm6YfAwpJOPhGuwcGv9GtpP0v0FbsscKs2ND7bzN14YPGEf


testing:
   DATABASE_ADAPTER: postgresql
   DATABASE_USER: root
   DATABASE_PASSWORD: root
   DATABASE_NAME: friend_booster_testing
   DATABASE_HOST: localhost
   DOMAIN: localhost
   AWS_ACCESS_KEY_ID: AKIAIBP3UKKWLGXTJYHA
   AWS_SECRET_ACCESS_KEY: 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
   REGION: 'us-west-2'
   AWS_BUCKET_NAME: its-get-brighter-staging
   FACEBOOK_APP_ID: 4545544757845412155
   FACEBOOK_APP_SERCRET: 4454455451454544545454
   FACEBOOK_APP_VERSION: 'v2.8'

production:
   DATABASE_ADAPTER: postgresql
   DATABASE_USER: root
   DATABASE_PASSWORD: root
   DATABASE_NAME: igb_website
   DATABASE_HOST: localhost
   DOMAIN: localhost
   AWS_ACCESS_KEY_ID: AKIAIBP3UKKWLGXTJYHA
   AWS_SECRET_ACCESS_KEY: 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
   REGION: 'us-west-2'
   AWS_BUCKET_NAME: its-get-brighter-staging
   FACEBOOK_APP_ID: 4545544757845412155
   FACEBOOK_APP_SERCRET: 4454455451454544545454
   FACEBOOK_APP_VERSION: 'v2.8'
   TWITTER_CONSUMER_KEY: bXFWp9nwoKRZ4oiJZ4FtpMNhB
   TWITTER_CONSUMER_SECRET:
xBysm6YfAwpJOPhGuwcGv9GtpP0v0FbsscKs2ND7bzN14YPGEf

# Staging
# production:
#   DATABASE_ADAPTER: postgresql
#   DATABASE_USER: igb_staging
#   DATABASE_PASSWORD: igb_staging
#   DATABASE_NAME: igb_development
#   DATABASE_HOST: igb-staging.c43bfw5renkv.us-west-2.rds.amazonaws.com
#   DOMAIN: localhost
#   AWS_ACCESS_KEY_ID: AKIAIBP3UKKWLGXTJYHA
#   AWS_SECRET_ACCESS_KEY: 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
#   REGION: 'us-west-2'
#   AWS_BUCKET_NAME: its-get-brighter-staging
#   FACEBOOK_APP_ID: 4545544757845412155
#   FACEBOOK_APP_SERCRET: 4454455451454544545454
#   FACEBOOK_APP_VERSION: 'v2.8'
#   GOOGLE_YOUTUBE_API_KEY: AIzaSyAOZpFNLMy0y4vs5ScWE0IaMq7nX-5OB7A
#   GOOGLE_YOUTUBE_CLIENT_ID:
781334102649-uks4t2v7p1cj2eintve3su7pjj5u8jrp.apps.googleusercontent.com
#   GOOGLE_YOUTUBE_CLIENT_SECRET: 9wcfYGe05Cht8rsiytU58-nK
#   TWITTER_CONSUMER_KEY: bXFWp9nwoKRZ4oiJZ4FtpMNhB
#   TWITTER_CONSUMER_SECRET:
xBysm6YfAwpJOPhGuwcGv9GtpP0v0FbsscKs2ND7bzN14YPGEf
#   IGB_FACEBOOK_UID: 10158476225585411
#   IGB_TWITTER_UID: 1022590795 
                 

                         

No comments:

Post a Comment

  Common Git Commands   Take clone of a repository git clone <remote-repository-url> ex: git clone  https://github.com/agricor/RegTech...