Skip to content

Instantly share code, notes, and snippets.

@nimeshpahadi
Last active December 28, 2020 09:57
Show Gist options
  • Save nimeshpahadi/8702960dd10fc10adbff20e207b2c86a to your computer and use it in GitHub Desktop.
Save nimeshpahadi/8702960dd10fc10adbff20e207b2c86a to your computer and use it in GitHub Desktop.
sudo gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
or
gpg2 --keyserver hkp://pool.sks-keyservers.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable --ruby
source /home/nimesh/.rvm/scripts/rvm
rvm get stable --autolibs=enable
rvm install ruby-2.6.6
rvm --default use ruby-2.6.6
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
gem update --system
gem -v
echo "gem: --no-document" >> ~/.gemrc
gem install rails -v 5.2.3
sudo apt-get -y install postgresql postgresql-contrib libpq-dev
sudo -u postgres psql postgres
\password postgres
create role rails_dev with createdb login password 'aqwe123';
rails new myapp -d postgresql
cd myapp/
vim config/database.yml
username: abc
password: 123
-- Uncomment line 40 and 44 for the database host configuration.
host: localhost
port: 5432
-- Now go to the test section and add the new configuration below:
database: myapp_test
host: localhost
port: 5432
username: abc
password: 123
rails db:setup
rails db:migrate
rails s -b 192.168.1.110 -p 8080 or rails s
-- kill puma process
lsof -wni tcp:3000
kill -9 (PID)
-- postgresql setup
sudo -u postgres psql
create user alphauser with password 'alphapassword';
create database alpha_database owner alphauser;
alter user alphauser superuser createrole createdb replication;
\q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment