New Ruby user trouble installing RVM - ruby

Before I start, let me say that I looked at all the similar questions and it appears that no one had this particular problem:
I installed git.
Next I ran this from the command line:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
My result is
bash: line 151: git: command not found
bash: line 153: git: command not found
ERROR: Unable to clone the RVM repository, attempted both git:// and https://
What did I do wrong here? I am attempting to install this on osx Lion.
Additionally, can someone explain to me what the beginning of the bash command does? bash < <(...)
Just for my own curiosity :)
Thanks!

You need to have git installed first. The command executes the script downloaded with curl from the given url using bash. The <(...) is apparently used to provide a list of commands as per http://tldp.org/LDP/abs/html/process-sub.html.

You either installed git wrong, or it's not in your path. Have you installed XCode? It should automatically install git 1.7.4 and put it in your path. You'll also need to have XCode installed to be able to compile any ruby versions using RVM.

Related

Problem installing git subrepo on MacOs bash 5

I was trying to install git subrepo on MacOs with bash 5.0.18 installed. When I source .bashrc, I get error message :
The git-subrepo command requires that 'Bash 4+' is installed. It
doesn't need to be your shell, but it must be in your PATH. You appear
to be on macOS. Try: 'brew install bash'. This will not change your
user shell, it just installs 'Bash 5.x'.
Is git subrepo not compatible with bash 5 or is there any solution to make it work?
https://github.com/ingydotnet/git-subrepo
apparently, I can install it using brew with less hassle:
brew install git-subrepo
It should be a PATH issue, as illustrated by ingydotnet/git-subrepo issue 463
I realized there was a part of my path not being specified which caused this issue.

Cygwin - can't run ruby command

When I run ruby -v in cygwin, it shows me the ruby which I have installed in windows. FYI - I never installed any ruby as a part of my cygwin installation.
But when I run gem list, I get the error:
/cygdrive/c/ruby/bin/gem:
C:/dev/ruby/bin/ruby.exe^M: bad interpreter: Permission denied
I Googled and found this problem a lot. But there is no one who explained what it means and why it happens. Can someone please answer those questions for me and help me to fix this problem?
Thank you very much !
Under cygwin, your best bet is to run the cygwin version of ruby, installed using the cygwin setup tool.
You can use regular ruby, but you will have interoperability issues like this.
What you are seeing here is the shell complaining about a ^M at the end of the "shebang" line of the gem script (first line that tells it what interpreter to use). This ^M is an artefact of the windows environment where all lines end with this character as well as just the newline character that unix uses on its own.
You could solve this problem by removing the newlines e.g. by using dos2unix command on gem but it won't be long before you run into further issues ...

grc.bashrc no such file or directory

I am newbie to OSX, I tried to install bash, but when I running the terminal I got this error msg: -bash: /usr/local/Cellar/grc/1.5/etc/grc.bashrc: No such file or directory
so how I can fix it?
Reading the output of brew info grc
grc: stable 1.5
http://korpus.juls.savba.sk/~garabik/software/grc.html
Conflicts with: cc65
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/grc.rb
==> Caveats
New shell sessions will start using GRC after you add this to your profile:
source "`brew --prefix`/etc/grc.bashrc"
suggests you look for and remove from your .bash_profile file a line similar to the last line in the output above.
I had the same issue where the shell (in my case zsh) had an error upon starting, which for me appeared after upgrading OS X.
The problem is that the brew command is called before the shell knows where the brew command is stored. To fix it, in your .bash_profile (or .zshrc) move this line:
source "`brew --prefix`/etc/grc.bashrc"
to be after this line:
export PATH=/usr/local/bin:/usr/local/sbin:$PATH

Installing SASS through my terminal on my MAC -newbie

I have done multiple searches for installing SASS through my terminal on my Mac, when I write the command gem install sass, it tells me
-bash: $: command not found"
so I tried the alternative sudo install process. My result is
-bash: $: command not found".
Am I missing something here?
Sorry for the dumb question. I'm just a web designer/developer trying to learn SASS, I did get a response once telling me this "WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information. To proceed, enter your password, or type Ctrl-C to abort. Password:"(My typing was correct) so I type my PW. it then tells me it's the wrong PW. - I have one PW on this machine. What am I doing wrong?
I did get this error message after a third try " You don't have write permissions into the /Library/Ruby/Gems/1.8 directory.
Jasons-MacBook-Pro:~ JHess$ "
Do I not have the right permissions set up to perform the SASS install? I found a similar question on Stack regarding this issue - and it told me to install RVM. What exactly is RVM? Is it some type of bundled package?
Any help would be GREATLY appreciated. I just attended a web conference in VA, "ConvergeRVA" and just recently graduated college, I'm not a seasoned vet like most peeps on here. But I would love to start learning SASS.
Note: I am running Mac OS X Lion 10.7.5
In order to use Sass you need Ruby installed. The error messages shows you have an old version 1.8.7
Update to a current version using RVM.
RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments
Copy and paste this into your terminal.
\curl -sSL https://get.rvm.io | bash -s stable --ruby
look at http://screencasts.org/episodes/how-to-use-rvm to learn how to use it.
After this is done try gem install sass again
You haven't installed Mac OS X Command Line Tools. It can be found at:
Xcode > Preferences > Downloads > Command Line Tool
Download & Install it, and restart the Terminal.

bash __git_ps1 command not found

I am a beginner trying to setup a developer environment on my new Mac following the steps from this link: http://vanderveer.be/setting-up-my-perfect-developer-environment-on-osx-10-8-mountain-lion-10-8-2-final-edition/.
After executing the files from git, my terminal window now shows:
rbenv: version `1.9.3-p194' not installed
-bash: __git_ps1: command not found
The first line only shows when I open a new terminal window, while the second shows everytime I press return no matter what I type into the terminal.
I have read through many questions on stackoverflow and tried to mimic their solutions to no avail. I think I've made a mistake in installing the package from git as I am not so experienced and I think now I may have messed up the configurations, and was also wondering if there is any way to go back to default settings for bash?
Many thanks!
Allen
If you've not installed a newer version of Git on your Mac, start by doing that. You can grab the download from here: http://git-scm.com/download
Once it's installed, you should source git-completion.sh and git-prompt.sh from your ~/.profile (or ~/.bashrc, if you have it):
source /usr/local/git/contrib/completion/git-completion.bash
source /usr/local/git/contrib/completion/git-prompt.sh
That should fix the __git_ps1 error.
I'm not a Rubyist, but the rbenv error is coming from the fact that the setup in the dotfiles you are following is trying to set the default Ruby version to "1.9.3-p194". The rbenv tool is there to make a number of different Ruby versions available, but you have to install them first. In your case, I think you need to run this:
rbenv install 1.9.3-p194
After that, the version will be available, and you shouldn't see the warning anymore.

Resources