Skip to content

Commit abde0e8

Browse files
authored
Update rails.md to use packaged rbenv (#492)
This updates the document to use the packaged rbenv instead of installing it from git. It also updates the version numbers to be more recent. epel-release installation is dropped since that only applies to Enterprise Linux. Even there EL8+ has nodejs packaged.
1 parent 2c78edd commit abde0e8

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

start/sw/web-app/rails.md

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,24 @@ order: 6
66

77
# Installing Ruby and Rails with rbenv
88

9-
The first step is to install dependencies for Ruby.
9+
The first step is to install dependencies for Ruby and rbenv.
1010

1111
```
12-
sudo dnf install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel
12+
sudo dnf install git-core zlib zlib-devel gcc-c++ patch readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison libcurl-devel sqlite-devel rbenv rbenv-build-rbenv
1313
```
1414

15-
Install rbenv
15+
Then configure your shell to enable rbenv:
1616

1717
```
18-
cd
19-
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
20-
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
2118
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
2219
source ~/.bashrc
23-
exec $SHELL
24-
25-
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
26-
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
27-
source ~/.bashrc
28-
exec $SHELL
2920
```
3021

31-
Install Ruby
22+
Install a Ruby version, such as 3.1.2. See `rbenv install --list` for available versions.
3223

3324
```
34-
rbenv install 2.6.6
35-
rbenv global 2.6.6
25+
rbenv install 3.1.2
26+
rbenv global 3.1.2
3627
ruby -v
3728
3829
```
@@ -42,12 +33,6 @@ Use this command if you do not want rubygems to install the documentation for ea
4233
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
4334
```
4435

45-
Install bundler
46-
47-
```
48-
gem install bundler
49-
```
50-
5136
Whenever you install a new version of Ruby or a gem, you should run the rehash sub-command. This will make rails executables known to rbenv, which will allow us to run those executables:
5237

5338
```
@@ -59,14 +44,13 @@ rbenv rehash
5944
Rails depends on a Javascript runtime, install nodejs.
6045

6146
```
62-
sudo dnf install epel-release
6347
sudo dnf install nodejs
6448
```
6549

6650
And now install Rails
6751

6852
```
69-
gem install rails -v 4.2.6
53+
gem install rails -v 7.1.2
7054
```
7155
```
7256
rbenv rehash

0 commit comments

Comments
 (0)