-
Clone the repository with:
git clone [email protected]:tosdr/edit.tosdr.org.git
in your working folder. -
Go to the folder:
cd edit.tosdr.org
. -
If you are on linux run
sh INSTALL_linux.sh
in your terminal. If you are on macOS runsh INSTALL_mac.sh
. -
Fix the Internet's biggest lie.
Install Ruby with Rbenv
(shamelessly copied from Rbenv doc)
This will get you going with the latest version of rbenv without needing a systemwide install.
-
Clone rbenv into
~/.rbenv
.$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
Optionally, try to compile dynamic bash extension to speed up rbenv. Don't worry if it fails; rbenv will still work normally:
$ cd ~/.rbenv && src/configure && make -C src
-
Add
~/.rbenv/bin
to your$PATH
for access to therbenv
command-line utility.$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
Ubuntu Desktop note: Modify your
~/.bashrc
instead of~/.bash_profile
.Zsh note: Modify your
~/.zshrc
file instead of~/.bash_profile
. -
Run
~/.rbenv/bin/rbenv init
and follow the instructions to set up rbenv integration with your shell. This is the step that will make runningruby
"see" the Ruby version that you choose with rbenv. -
Restart your shell so that PATH changes take effect. (Opening a new terminal tab will usually do it.)
-
Install [ruby-build][], which provides the
rbenv install
command.mkdir -p "$(rbenv root)"/plugins git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
-
Verify that rbenv is properly set up using this rbenv-doctor script:
$ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash Checking for `rbenv' in PATH: /usr/local/bin/rbenv Checking for rbenv shims in PATH: OK Checking `rbenv install' support: /usr/local/bin/rbenv-install (ruby-build 20170523) Counting installed Ruby versions: none There aren't any Ruby versions installed under `~/.rbenv/versions'. You can install Ruby versions like so: rbenv install 2.2.4 Checking RubyGems settings: OK Auditing installed plugins: OK
Install Rails, Postgres, Yarn, etc
sudo apt install rails postgresql libpq-dev build-essential libssl-dev libreadline-dev zlib1g-dev
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 update && sudo apt install yarn
In your code directory run:
git clone https://github.com/tosdr/edit.tosdr.org
cd edit.tosdr.org
rbenv install 2.6.5
rbenv local 2.6.5
gem install bundler
bundle install
yarn
rails db:create db:migrate db:seed
rails s
And you're ready to code !
If you have installed Docker compose, getting the application running involves two one-time steps, after which it can be started with a single command in the future.
To prepare the application, run the following two commands inside the repository folder to build it and then initialise the database:
$ docker-compose build
$ docker-compose run web bash -c "sleep 1; rails db:create db:migrate"
From then on, you can start the application by running:
$ docker-compose up
(Add the --build
argument if you add or remove dependencies.)
- If it's a fix use [fix] as a prefix of your message, if it's an enhancement, use [enh], [mod] if it's a modification, [sec] if it's security.
- When you create a pull request, please make sure you checked everything in the PR template.
Have fun!