0

I have followed this thread and followed Linuxios' answer, everything was working fine but then I get

-bash: export: `[[': not a valid identifier
-bash: export: `-s': not a valid identifier
-bash: export: `/Users/duaneadam/.rvm/scripts/rvm': not a valid identifier
-bash: export: `]]': not a valid identifier

So, I went and removed from .bash__profile via Terminal.

export PATH=$PATH:/usr/local/git/bin/ [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

.. thinking that lines of code is the problem but what I get after that is even worse. For some reasons.. Ruby is not installed.. again. So, I re-added the lines of code and tried rebooting/restarting my Mac but problem still persist. Screenshots:

.bash_profile: .bash_profile Solution please? I even tried re-installing using his method. Gosh, this is hard maybe Ruby on Rails isn't just for me.

Community
  • 1
  • 1
Nil
  • 361
  • 1
  • 3
  • 9
  • Make sure to install the command line tools either from within xcode or as a standalone installation. – Gaurav Agarwal Feb 03 '13 at 06:14
  • Do check out this [awesome tutorial by Moncef Belyamani](http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/) covering step-by-step instructions for setting up Git, RVM, & Ruby on Mac. Made it a breeze when I tried to set up my dev env on a new mac recently. – Prakash Murthy Feb 03 '13 at 14:14

1 Answers1

2

Setting up ruby with rvm can get pretty complicated at times. A few golden rules is never to sudo when using a package manager like rvm.

Try the following:

  • rvm implode (This essentially removes the rvm installation completely.)
  • Remove all references of rvm from ~/.bash_profile and ~/.bashrc
  • which ruby (The output should be something like /usr/bin, also ruby --version should be 1.8.7, the default bundled with OS X.)
  • Install rvm again in a single user mode.
  • Install the ruby version of your choice.
  • Make sure to create the .rvmrc file where ever the ruby program resides. (Typical contents of .rvmrc -> rvm use ruby-version@gemset-name --create; eg: rvm use 1.9.3@my-awesome-project --create)
  • cd into the directory with .rvmrc
  • Make sure the right gemset is loaded with rvm gemset list

Also ensure that rvm is loaded as a function. (You can verify this by typing type rvm | head -1 in the console.)

Some more points, which were helpful to me from http://jfire.io/blog/2012/03/02/xcode-4-dot-3-homebrew-and-ruby/:

  • Install apple-gcc42, autoconf and automake (Using a package manager like homebrew can be useful.)
  • Also rvm requirements tells you what are the other tools you need to install.

Cheers!

Gaurav Agarwal
  • 13,952
  • 4
  • 27
  • 39
  • Done with rvm implode but it says some files need to be removed manually. Removed .bash_profile and .bashrc the which ruby outputs the same as you posted. That is `/usr/bin/ruby` – Nil Feb 03 '13 at 05:58
  • `\curl -L https://get.rvm.io | bash -s stable` I would suggest installing vanilla rvm and getting it working. – Gaurav Agarwal Feb 03 '13 at 06:06
  • You know what.. I give up, I think I'll remove Ruby and Rails. I have tried a lot of method. Googling this and that, watching videos, reading wikis. How do I remove everything? – Nil Feb 03 '13 at 10:30
  • Just in case anyone wondering how to remove: Here are some links, i) http://stackoverflow.com/questions/3558656/how-to-remove-rvm-ruby-version-manager-from-my-system ii) http://mkoby.com/2011/06/03/completely-removing-rvm/ – Nil Feb 03 '13 at 10:55
  • All right.. But if you would state the issues you are getting, then perhaps I would be of better help. – Gaurav Agarwal Feb 03 '13 at 10:58
  • Okay, let's say after I removed everything. From where do I start? You said to reinstall RVM but which method? There are way too much and I am quite confused. – Nil Feb 03 '13 at 11:16
  • The script `curl -L https://get.rvm.io | bash -s stable` should help you setup rvm. – Gaurav Agarwal Feb 03 '13 at 11:18
  • `rvm requirements` first. Make sure rvm is setup properly. Try `type rvm | head -1` to ensure rvm is a function. – Gaurav Agarwal Feb 03 '13 at 11:54
  • `brew install autoconf automake apple-gcc42 libtool pkg-config openssl readline libyaml sqlite libxml2 libxslt libksba` should help you. – Gaurav Agarwal Feb 03 '13 at 12:19
  • Okay, after that? I'm done (I guess) other than the errors and warnings. I think the errors should be fine as it says that it is already installed but as for the MacPorts, I'm unsure. – Nil Feb 03 '13 at 12:33
  • I guess that is it then.. `brew doctor` if you have any issues with brew itself. But I guess most of the issues are ironed out. Try installing a ruby version. – Gaurav Agarwal Feb 03 '13 at 12:36