2

I've tried everything. Every YouTube guide. Nothing simply explains how to get from point A to point B.

Homebrew Git RVM and Ruby are all installed. For some reason Rails is not.

I'm new to the whole ruby thing, and getting everything installed has been an absolute nightmare. Everything is out of date. What do I do?

Franklinc
  • 423
  • 1
  • 3
  • 11

3 Answers3

1

If you have installed RVM,

rvm use 2.3.1

Then check gems in current gemset using,

rvm gemset list ### gives a list of gemset for ruby 2.3.1
gem list ###installed gems in current gemset

Let me know,.if it didn't work.

Hasmukh Rathod
  • 1,108
  • 1
  • 14
  • 20
  • It did not work, states "RVM is not a function, selecting rubies with 'rvm use ...' will not work." And when I do rvm gemset list I got this "# Zion at Franklins-MacBook-Pro.local in ~ [9:12:26] → rvm gemset list gemsets for system (found in /Users/Zion/.rvm/gems/system) => (default) *" @Hasmukh Rathod – Franklinc Sep 06 '16 at 16:14
  • I had the same issue. First, solve the 'rvm use..' issue here: http://stackoverflow.com/questions/23963018/rvm-is-not-a-function-selecting-rubies-with-rvm-use-will-not-work Then follow the accepted answer and you should be on your way! – Erick Mar 10 '17 at 16:43
1

Assuming you have RVM installed correctly:

1) Open Terminal.

2) Type rvm list to see which versions of Ruby you have installed.

3) Type rvm use ruby-2.3.1 if you want to use Ruby 2.3.1.

4) Type rvm gemset create Rails500 to create a gemset for Rails 5.0.0

5) Type rvm gemset use Rails500 to make Rails 5.0 your current gemset

6) Type gem install rails -v 5.0.0 to install Rails 5 to your Rails500 gemset

7) Type bundle install bring everything up to date.

Now you have Rails 5.0 running under a Rails500 gemset against Ruby 2.3.1. Remember to use ruby-2.3.1 and use gemset Rails500 whenever you start a new session in Terminal if you want to maintain multiple versions of Ruby and multiple gemsets.

To make a version of Ruby default, type the following into Terminal:

rvm --default use 2.1.1

To keep a default gemset, just rvm gemset use default and make sure you install your gems into that default gemset by use-ing it before installation.

This covers 80% of everything you'll need to know about RVM.

Also, remember to never install rbenv, because it's not compatible with RVM -- stick with one or the other.

EDIT:

It seems you're having problems with your Terminal settings as well.

1) Open Terminal

2) From the Terminal menu, select Preferences

3) Select the Command (complete path) radio button

4) Make sure the text field beneath the radio button reads /bin/bash

5) Close the Preferences dialog and restart Terminal

6) Try using Ruby 2.3.1 via RVM

MarsAtomic
  • 10,436
  • 5
  • 35
  • 56
  • 1) Did it 2) # Zion at Franklins-MacBook-Pro.local in ~ [9:16:29] → rvm list rvm rubies ruby-2.2.0 [ x86_64 ] ruby-2.3.0 [ x86_64 ] ruby-2.3.1 [ x86_64 ] # Default ruby not set. Try 'rvm alias create default '. # => - current # =* - current && default # * - default 3) → rvm use ruby-2.3.1 RVM is not a function, selecting rubies with 'rvm use ...' will not work. You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use `/bin/bash --login` as the command. @MarsAtomic – Franklinc Sep 06 '16 at 16:18
  • See edited answer. You're not loading your bash profile. – MarsAtomic Sep 06 '16 at 17:13
  • What would be the equivalent in iTerm2 using Zsh? Because in my straight mac default terminal it is correctly now stating 2.3.1 as the Ruby v, but in iTerm2 zsh, it's still stating 2.0.0 – Franklinc Sep 06 '16 at 17:45
  • At this point, your original question has been answered, so it would be a good gesture on your part to click the checkmark to the left of the answer to let people know that it helped you switch between versions of Ruby using RVM. Now you're asking a different question: "how do I set up iTerm Zsh." At this point, you have two choices: post a question in a forum more suited to tool discussion, like superuser or Google for info now that you know you're not loading your bash profile. – MarsAtomic Sep 06 '16 at 18:01
  • I'm new to Stack overflow & Development in general. Thanks again for your assistance. – Franklinc Sep 06 '16 at 18:09
  • Check out this [answer](http://stackoverflow.com/questions/1276703/how-to-make-zsh-run-as-a-login-shell-on-mac-os-x-in-iterm). You can get what you want by convincing iterm2 to run as a login shell. – MarsAtomic Sep 06 '16 at 20:56
1

Assuming you have got rvm, just write:

rvm install 2.3.1
rvm use 2.3.1

Then you can install rails by gem install rails command.

batinex
  • 33
  • 8
  • I do have RVM installed; → rvm -v rvm 1.27.0 (master) by Wayne E. Seguin , Michal Papis [https://rvm.io/] BUT when I do what you say, I get this : → rvm use 2.3.1 RVM is not a function, selecting rubies with 'rvm use ...' will not work. You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use `/bin/bash --login` as the command. Please visit https://rvm.io/integration/gnome-terminal/ for an example. – Franklinc Sep 06 '16 at 16:12
  • It seems as if i'm missing some sort of correct preferences to allow me to use RVM as a function int he command line, im not sure. @batinex – Franklinc Sep 06 '16 at 16:20