-
Notifications
You must be signed in to change notification settings - Fork 0
Developer Installation Instructions (Main)
Dave Taylor edited this page Apr 6, 2024
·
8 revisions
Installation of rails basically following the standard gorails.com instructions specifically for Ubuntu 22.04
see: gorails instructions for Ubuntu 22.04 desktop
sudo -i
apt-get update
apt-get install git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
exit
git clone https://github.com/excid3/asdf.git ~/.asdf
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc
echo 'legacy_version_file = yes' >> ~/.asdfrc
echo 'export EDITOR="code --wait"' >> ~/.bashrc
exec $SHELL
cat ~/.asdfrc
# it should show: legacy_version_file = yes
asdf --version
# it should show: v0.14.0-23f4ce5
asdf plugin add ruby
asdf install ruby 3.3.0
asdf global ruby 3.3.0
which ruby
# it should show: ~/.asdf/shims/ruby
gem update --system
asdf plugin add nodejs
asdf install nodejs 20.11.0
asdf global nodejs 20.11.0
which node
# it should show: ~/.asdf/shims/node
node -v
# it should show: v20.11.0
npm install -g yarn
# it should show: npm notice Run npm install -g [email protected] to update!
npm install -g [email protected]
git --version
# it should show: git version 2.34.1
Note: if you prefer a different editor than vi, such as vim, use that in the instructions below
git config --global user.name "Your Name"
git config --global user.email your@email
git config --global core.editor vi
git config --global alias.log-list 'log --date=iso --graph --pretty=tformat:"%ad, %h, %s" -n 10 --date=local'
git config --global --list
# it should show: user.name=Your Name
# user.email=your@email
# core.editor=vi
# alias.log-list=log --date=iso --graph --pretty=tformat:"%ad, %h, %s" -n 10 --date=local
# see of check for key pairs already existing for your user.
ls -al ~/.ssh
ssh-keygen -t ed25519 -C "[email protected]"
# it should show: Generating public/private ed25519 key pair.
# it should show: Enter file in which to save the key (~/.ssh/id_ed25519):
cat ~/.ssh/id_ed25519.pub
https://github.com/settings/keys
give a title paste in the public key just listed on your terminal
ssh -T [email protected]
# If you see: The authenticity of host 'github.com (140.82.114.4)' can't be established.
# Are you sure you want to continue connecting (yes/no/[fingerprint])?
# Then enter yes so your computer remembers the IP address you have for github
# it should show:
# Hi <yourGithubUserName>! You've successfully authenticated, but GitHub does not provide shell access.
gem install rails -v 7.1.3
rails -v
# it should show:Rails 7.1.3
sudo apt install postgresql libpq-dev
systemctl status postgresql
sudo -u postgres createuser dave -s
# You can ignore the warning: could not change directory to "/home/<ubuntuUserName>": Permission denied
psql postgres
# Note: we are using a password of password, since the development environment is not exposed to the internet.
create database glycemic_development;
# it should show: CREATE DATABASE
create user glycemic_development with encrypted password 'password';
# it should show: CREATE ROLE
alter user glycemic_development CREATEDB;
# it should show: ALTER ROLE
alter database glycemic_development owner to glycemic_development;
# it should show: ALTER DATABASE
# Note: we are using a password of password, since the test environment is not exposed to the internet.
create database glycemic_test;
# it should show: CREATE DATABASE
create user glycemic_test with encrypted password 'password';
# it should show: CREATE ROLE
alter user glycemic_test CREATEDB;
# it should show: ALTER ROLE
alter database glycemic_test owner to glycemic_test;
# it should show: ALTER DATABASE
confirm databases set up properly, with the owner of the databases matches the database name (by convention):
\list
# it should show something like:
# Name | Owner
#----------------------+----------------------
# glycemic_development | glycemic_development
# glycemic_test | glycemic_test
# postgres | postgres
# template0 | postgres
# template1 | postgres
exit psql
\q
asdf install ruby 3.1.3
# you should see: ==> Installed ruby-3.1.3 to ~/.asdf/installs/ruby/3.1.3
bundle install
Bundler 2.3.26 is running, but your lockfile was generated with 2.4.3. Installing Bundler 2.4.3 and restarting using that version. ... # You should see: Bundle complete! 27 Gemfile dependencies, 102 gems now installed.
bin/rails db:reset
# you should see glycemic_development and glycemic_test databases dropped and created
bin/rails db:migrate:status
# You should see: up 20230422165418 Start over
bin/rails test test
# all tests should pass or be skipped.
See: Rebuild Database