Install Ruby based on CONSUL's .ruby-version

This commit is contained in:
Javi Martín
2020-04-18 15:59:20 +02:00
parent 2b1a4237b9
commit 127ada280f
13 changed files with 75 additions and 115 deletions

View File

@@ -2,20 +2,41 @@
Before installing Consul and having it up and running make sure you all [prerequisites](prerequisites.md) installed.
1. First, clone the [Consul Github repository](https://github.com/consul/consul/):
1. First, clone the [Consul Github repository](https://github.com/consul/consul/) and enter the project folder:
```bash
git clone https://github.com/consul/consul.git
cd consul
```
2. Go to the project folder and install the gems stack using [Bundler](http://bundler.io/):
2. Install the Ruby version we need with your Ruby version manager. Here are some examples:
```bash
rvm install `cat .ruby-version` # If you're using RVM
rbenv install `cat .ruby-version` # If you're using rbenv
asdf install ruby `cat .ruby-version` # If you're using asdf
```
3. Check we're using the Ruby version we've just installed:
```bash
ruby -v
=> # (it should be the same as the version in the .ruby-version file)
```
4. Install [Bundler](http://bundler.io/):
```bash
gem install bundler
```
5. Install the required gems using Bundler:
```bash
cd consul
bundle
```
3. Copy the environment example configuration files inside new readable ones:
6. Copy the environment example configuration files inside new readable ones:
```bash
cp config/database.yml.example config/database.yml
@@ -24,7 +45,7 @@ cp config/secrets.yml.example config/secrets.yml
And setup database credentials with your `consul` user in your new `database.yml` file.
4. Run the following [Rake tasks](https://github.com/ruby/rake) to create and fill your local database with the minimum data to run the application:
7. Run the following [Rake tasks](https://github.com/ruby/rake) to create and fill your local database with the minimum data to run the application:
```bash
rake db:create
@@ -33,13 +54,13 @@ rake db:dev_seed
rake db:test:prepare
```
5. Check everything is fine by running the test suite (beware it might take more than an hour):
8. Check everything is fine by running the test suite (beware it might take more than an hour):
```bash
bin/rspec
```
6. Now you have all set, run the application:
9. Now you have all set, run the application:
```bash
bin/rails s