0

I'm a total beginner with the terminal and I wanted to learn Rails. I have a mac with Lion 10.7.5 on it. I wanted to install Rails and it seems to be installed and then when i typed rails -v i got this message :

Rails is not currently installed on this system. To get the latest version, simply type:

    $ sudo gem install rails

You can then rerun your "rails" command.

So I went to stack overflow and saw lots of people having the same problem. So I tried the things people recommended and none of them worked. Then I took the not that smart decision to delete the ruby2.1.1 in order to reinstall it with :

 brew install ruby

And here start the mess :

Warning: You seem to have osx-gcc-installer installed.
Homebrew doesn't support osx-gcc-installer. It causes many builds to fail and
is an unlicensed distribution of really old Xcode files.
Please install the CLT or Xcode 4.6.3.

I already have Xcode 4.6.3

Warning: It appears you have MacPorts or Fink installed.

Not sure what to do about it

Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.

Warning: ruby-2.1.1 already installed

So I typed in : rvm use ruby 2.1.1

And I got :

Warning! PATH is not properly set up, '/Users/me/.rvm/gems/ruby-2.1.1/bin' is   not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'.
ruby-2.1.1 is not installed.

To install do: 'rvm install ruby-2.1.1'

so I did it and I got :

Downloaded archive checksum did not match, archive was removed!
If you wish to continue with not matching download add '--verify-downloads 2' after the command.
Downloading https://rvm.io/binaries/osx/10.7/x86_64/ruby-2.1.1.tar.bz2 failed.

and

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-O3 - 
I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure -- 
prefix=/Users/me/.rvm/rubies/ruby-2.1.1 --disable-install-doc --enable-shared',
showing last 15 lines of /Users/me/.rvm/log/1397387601_ruby-2.1.1/configure.log

Thank you if you can help I don't know what to do know

Ps : Other test: ruby -v I got

ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]

rvm list

Warning! PATH is not properly set up, '/Users/me/.rvm/gems/ruby-2.1.1/bin' is  not at first place,
     usually this is caused by shell initialization files - check them for 'PATH=...' entries,
     it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
     to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'.

rvm use ruby-2.1.1

 ruby-2.1.1 is not installed.

echo $PATH

/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/Users/me/.rvm/gems/ruby-2.1.1/bin:/Users/me/.rvm/gems/ruby-2.1.1@global/bin:/Users/me/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin:/Users/me/.rvm/bin:/Users/me/.rvm/bin:/Users/me/.rvm/bin

which ruby

/usr/bin/ruby

rvm uninstall ruby-2.1.1

Warning! PATH is not properly set up, '/Users/me/.rvm/gems/ruby-2.1.1/bin' is not at first place,
     usually this is caused by shell initialization files - check them for 'PATH=...' entries,
     it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
     to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'.
ruby-2.1.1 - #removing src/ruby-2.1.1..
ruby-2.1.1 - #removing default ruby interpreter............

and my .bash_profile

 [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile 
  [[ -s      "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
# Load RVM into a shell     session *as a function* 
 PATH=$PATH:$HOME/.rvm/bin source "$HOME/.rvm/scripts/rvm"

and finally my .bashrc

export PATH="/usr/local/heroku/bin:$PATH"

PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
source "$HOME/.rvm/scripts/rvm
real1
  • 1
  • 2
  • put `/Users/me/.rvm/gems/ruby-2.1.1/bin` to the first place on path. Do you use zsh or bash? – Малъ Скрылевъ Apr 13 '14 at 19:00
  • Hi when I do so it answered : -bash: /Users/me/.rvm/gems/ruby-2.1.1/bin: is a directory So I guess I use -bash – real1 Apr 14 '14 at 07:37
  • You do something others... just add to your shell init script: `PATH=$PATH:$HOME/.rvm/bin`, and then `source "$HOME/.rvm/scripts/rvm"` to the end of it. – Малъ Скрылевъ Apr 14 '14 at 07:42
  • I had "PATH=$PATH:$HOME/.rvm/bin" and "source "$HOME/.rvm/scripts/rvm" to the .bashrc file at /Users/me. Then I relaunch rvm install ruby 2.1.1 and I got the same errors. Thanks for helping me – real1 Apr 14 '14 at 07:51
  • please move then into the `.bash_profile` – Малъ Скрылевъ Apr 14 '14 at 07:54
  • Still the same error. But I just saw I forget to report one error : "% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 6671k 100 6671k 0 0 463k 0 0:00:14 0:00:14 --:--:-- 496k Downloaded archive checksum did not match, archive was removed! If you wish to continue with not matching download add '--verify-downloads 2' after the command. Downloading https://rvm.io/binaries/osx/10.7/x86_64/ruby-2.1.1.tar.bz2 failed." – real1 Apr 14 '14 at 08:03
  • update your post. pls – Малъ Скрылевъ Apr 14 '14 at 08:05
  • it seems that your ruby isn't installed properly to rvm? – Малъ Скрылевъ Apr 14 '14 at 08:06
  • please also issue `rvm list`, and `ruby -v` – Малъ Скрылевъ Apr 14 '14 at 08:06
  • I guess the problem is that sometimes he thinks that ruby 2.1.1 is still installed sometimes not. When i do rvm list I got `warning! PATH is not properly set up, '/Users/me/.rvm/gems/ruby-2.1.1/bin' is not at first place, usually this is caused by shell initialization files - check them for 'PATH=...' entries, it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'.` – real1 Apr 14 '14 at 08:08
  • Ok when I do ruby -v i got `ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0]` – real1 Apr 14 '14 at 08:14
  • update post please, and issue `echo $PATH` – Малъ Скрылевъ Apr 14 '14 at 08:18
  • where the lines `/opt/local/bin:/opt/local/sbin` from. then issue `which ruby` – Малъ Скрылевъ Apr 14 '14 at 08:26
  • I updated, thanks again for your time, when I do echo $PATH I got `/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/Users/me/.rvm/gems/ruby-2.1.1/bin:/Users/me/.rvm/gems/ruby-2.1.1@global/bin:/Users/me/.rvm/rubies/ruby-2.1.1/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin:/Users/me/.rvm/bin:/Users/me/.rvm/bin:/Users/me/.rvm/bin` I put it in the main post. – real1 Apr 14 '14 at 08:28
  • I don't know where `/opt/local/bin:/opt/local/sbin` comes from. When I typed in which ruby I got `/usr/bin/ruby` – real1 Apr 14 '14 at 08:44
  • it seems that `/Users/me/.rvm/gems/ruby-2.1.1/bin` contains no ruby. because `/usr/bin` is after it. you just need properly setup the ruby 2.1.1. Just uninstall, and then install it again. – Малъ Скрылевъ Apr 14 '14 at 08:59
  • When I do rvm reinstall ruby 2.1.1 I go the same errors. Do you mean reinstall rvm ? – real1 Apr 14 '14 at 09:17
  • please issue `rvm uninstall ruby-2.1.1` and update the post with its answer – Малъ Скрылевъ Apr 14 '14 at 09:31
  • So i did, and i got `Warning! PATH is not properly set up, '/Users/me/.rvm/gems/ruby-2.1.1/bin' is not at first place, usually this is caused by shell initialization files - check them for 'PATH=...' entries, it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles', to fix temporarily in this shell session run: 'rvm use ruby-2.1.1'. ruby-2.1.1 - #removing src/ruby-2.1.1.. ruby-2.1.1 - #removing default ruby interpreter............` – real1 Apr 14 '14 at 09:53
  • ` #removing default ruby interpreter............` this is removed the ruby. please show `.ruby_profile`. – Малъ Скрылевъ Apr 14 '14 at 10:01
  • Do you know where is .ruby_profile please ? – real1 Apr 14 '14 at 10:19
  • sorry `~/.bash_profile` – Малъ Скрылевъ Apr 14 '14 at 10:48
  • ~/.bash_profile : `[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* PATH=$PATH:$HOME/.rvm/bin source "$HOME/.rvm/scripts/rvm"` – real1 Apr 14 '14 at 11:08
  • I updated it, thanks again for your help – real1 Apr 14 '14 at 19:24

1 Answers1

0

The problem is in last line of your .bash_profile, please change it as follows, and retry:

[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile 
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

PATH=$PATH:$HOME/.rvm/bin
Малъ Скрылевъ
  • 16,187
  • 5
  • 56
  • 69
  • I did replace with your text, then when I run rvm install ruby-2.1.1 I got the exact same error as before. – real1 Apr 15 '14 at 11:56
  • Something mixups into the PATH, we need to find what is exactly. please update post with .bashrc – Малъ Скрылевъ Apr 15 '14 at 12:02
  • And that is not error, just warning. And below it valid text for the command – Малъ Скрылевъ Apr 15 '14 at 12:08
  • I just updated it with .bashrc . I don't know what you mean by provide output for /etc/profile when I typed it in the terminal I have to "sudo" it, ortherwise permission is denied `sudo: /etc/profile: command not found` – real1 Apr 15 '14 at 13:50
  • I did something stupid now I'm lost. I found an old railsinstaller uninstaller and launch it. Now I have a message `-bash: /etc/profile.d/sm.sh: No such file or directory -bash: /etc/profile.d/rvm.sh: No such file or directory` – real1 Apr 19 '14 at 20:17
  • @real1 Where have you it? – Малъ Скрылевъ Apr 21 '14 at 05:24
  • In the terminal at each opening. Maybe I should reinstall os X. – real1 Apr 21 '14 at 17:06
  • Hi, I'm currently having lots of trouble with my other softwares to, so I'm gonna reinstall the entire Mac os X. Thanks a lot for your time, I learned a lot about way things works with os X and Ruby through this exchange. Cheers! – real1 Apr 27 '14 at 21:29