@@ -22,16 +22,35 @@ sudo snap install node --classic --channel=18
2222echo " Installs ImageMagick for image processing"
2323sudo apt-get install imagemagick --fix-missing -y
2424
25- echo " Installs RVM (Ruby Version Manager) for handling Ruby installation"
26- # Retrieve the GPG key.
27- curl -sSL https://rvm.io/pkuczynski.asc | gpg --import -
28- curl -sSL https://get.rvm.io | bash -s stable
29- source ~ /.rvm/scripts/rvm
25+ echo " Install rbenv (Ruby version manager) for handling the Ruby installation"
26+ echo " gem: --no-ri --no-rdoc" > ~ /.gemrc
27+
28+ RBENV_INSTALL_PATH=" $HOME /.rbenv"
29+ if [ -d " $RBENV_INSTALL_PATH " ]; then
30+ echo " rbenv already installed"
31+ else
32+ curl -fsSL https://github.com/rbenv/rbenv-installer/raw/HEAD/bin/rbenv-installer | bash
33+
34+ echo " Configuring rbenv for your Shell"
35+ if [[ " $SHELL " == * " bash" ]]; then
36+ echo ' eval "$($HOME/.rbenv/bin/rbenv init - bash)"' >> ~ /.bashrc
37+ elif [[ " $SHELL " == * " zsh" ]]; then
38+ echo ' eval "$($HOME/.rbenv/bin/rbenv init - zsh)"' >> ~ /.zshrc
39+ else
40+ echo " Unknown Shell. Please configure rbenv manually."
41+ echo " Please visit: https://github.com/rbenv/rbenv"
42+ fi
43+ fi
3044
31- echo " Installs Ruby"
32- rvm install 3.1.2
33- rvm use 3.1.2 --default
45+ echo " Load rbenv config in install script"
46+ eval " $( $HOME /.rbenv/bin/rbenv init - bash) "
3447
48+ echo " Install Ruby"
49+ RUBY_VERSION=3.1.3
50+ rbenv install " $RUBY_VERSION "
51+ rbenv global " $RUBY_VERSION "
52+
53+ echo " Install Rails"
3554echo " gem: --no-ri --no-rdoc" > ~ /.gemrc
3655gem install bundler rails
3756
@@ -41,9 +60,7 @@ echo -e "Now we are going to print some information to check that everything is
4160
4261echo -n " Should be sqlite 3.22.0 or higher: sqlite "
4362sqlite3 --version
44- echo -n " Should be rvm 1.29.8 or higher: "
45- rvm --version | sed ' /^.*$/N;s/\n//g' | cut -c 1-11
46- echo -n " Should be ruby 3.0 or higher: "
63+ echo -n " Should be Ruby 3.1.3 or higher: "
4764ruby -v | cut -d " " -f 2
4865echo -n " Should be Rails 7.0 or higher: "
4966rails -v
@@ -55,12 +72,6 @@ and we will help you do the installation the manual way at the event.
5572
5673Congrats!
5774
58- Make sure that all works well by running the application generator command:
59- $ rails new railsgirls
60-
61- If you encounter the message:
62- The program 'rails' is currently not installed.
63-
64- It is just a hiccup with the shell, solutions:
65- $ source ~/.rvm/scripts/rvm
66- Allow login shell, example http://rvm.io/integration/gnome-terminal/"
75+ Open a new Terminal tab/window and make sure that all works well
76+ by running the application generator command:
77+ $ rails new railsgirls"
0 commit comments