Suggested changes to Ubuntu 18.04 documentation
I am totally new to Ruby and started with the installation documentation here (https://gorails.com/setup/ubuntu/18.04) on a totally fresh install of Ubuntu 18.04 LTS
This isn't a complaint, I was able to work through these issues, but someone with less Ubuntu experience might not be able to so I wanted to propose some changes if that's alright.
First, git
is not installed out of the box so the repo cannot be cloned without it.
sudo apt-get install git
Once rbenv
is installed, trying to install Ruby will give you a compile error unless we also
sudo apt-get install build-essentials
When installing the compiler, we'll be told there are some extra missing dependencies
sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev
After installing Ruby, Rails, and MySQL, creating the database with the given command will give an error (even without setting a password.) Setting a MySQL password and modifying the config/database.yml
file will resolve this issue.
Finally, when trying to run rails server
in the last step, the command will fail unless nodejs is also installed
sudo apt-get install nodejs
And then will fail again without the (updated) version of Yarn. The default in the Ubuntu repo is not a recent enough version, so we need to add the Yarn repo, update, and install:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
Once the above are followed, then the server will finally start and you're ready to begin!
The "Installing Ruby" step covers installing git, node, yarn, build essentials and the libssl, libreadline and zlib libraries. Sounds like you might have missed those steps.
Wow! So it does! That's so strange that I somehow missed a whole section. Even more strange that I'm apparently so tired I documented it before double checking the workflow. So sorry! Thank you, I'm so excited to get started here. :)
haha! ive done that many times myself. Coding while tired doesnt work out very well.
Maybe a cool feature to add is checkboxes so you can see which steps youve completed!
Hey @chris I tried the setup again (using a VM this time, dual boot was being a pain), this time using Postgres, and it seems Ubuntu 18.04 doesn't have support for postgres 11 out of the box.
I double checked the doc this time (lol), and I wasn't able to find these steps...these helped me successfully install Postgres:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
RELEASE=$(lsb_release -cs)
echo "deb http://apt.postgresql.org/pub/repos/apt/ ${RELEASE}"-pgdg main | sudo tee /etc/apt/sources.list.d/pgdg.list
Once the above were input, I was able to continue with the Postgres installation. :)