Last active
March 17, 2020 20:46
-
-
Save donrestarone/bdaabf4142952073510c8b39e64b48b3 to your computer and use it in GitHub Desktop.
script for installing ruby with rbenv and rails 6 on raspbian
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install htop build-essential zlib1g-dev openssl libreadline6-dev git-core zlib1g libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf automake libtool bison libgecode-dev -y | |
sudo apt-get install libpq-dev | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
source ~/.bashrc | |
rbenv install 2.6.5 | |
rbenv global 2.6.5 | |
sudo apt-get update ; sudo apt-get upgrade -y --force-yes | |
sudo apt-get dist-upgrade -y | |
echo 'gem: --no-ri --no-rdoc' >> ~/.gemrc | |
gem install execjs | |
sudo apt-get install nodejs | |
gem install rails | |
rbenv rehash | |
# depending on your rails application, you will need to change bcrypt in your gemfile to gem 'bcrypt', '3.1.12' :: this is for ARM support | |
# setup postgres | |
sudo apt install postgresql | |
# connect as postgres user | |
sudo su postgres | |
# drop into the psql CLI | |
psql | |
# create the role for pi in psql, so rails can create/manage databases. Note that postgres=# just means that these roles need to be typed into a psql console | |
postgres=# CREATE ROLE pi ; | |
postgres=# ALTER ROLE "pi" WITH LOGIN; | |
postgres=# ALTER USER "pi" CREATEDB; | |
# to quit out of the psql console | |
postgres=# \q | |
# to exit out of the postgres user and back into pi | |
exit | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment