0

I'm a novice when it comes to terminal stuff (PATH, rvm and ruby) and while trying to fix Sass / Compass I accidently uninstalled ruby ('rvm reinstall all --force' failed). So I'm trying to reinstall ruby-1.9.3-p374 (version required) without taking as long as it did last time (2 days groan)

One complication is last time I installed ruby, I tried Macports, rvm, rbenv methods and I'm worried my system is a mess.

Running: OSX 10.9.2 Mavericks

My installation attempt:

$ rvm install ruby-1.9.3-p374 --with-gcc=gcc
Warning! PATH is not properly set up, '/Users/ash/.rvm/gems/ruby-1.9.3-p374/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-1.9.3-p374'.
ruby-1.9.3-p374 - #removing src/ruby-1.9.3-p374..
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
Warning: found user selected compiler 'gcc', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/ash/.rvm/rubies/ruby-1.9.3-p374, this may take a while depending on your cpu(s)...
ruby-1.9.3-p374 - #downloading ruby-1.9.3-p374, this may take a while depending on your connection...
ruby-1.9.3-p374 - #extracting ruby-1.9.3-p374 to /Users/ash/.rvm/src/ruby-1.9.3-p374...
ruby-1.9.3-p374 - #applying patch /Users/ash/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p374 - #configuring.................................................
ruby-1.9.3-p374 - #post-configuration.
ruby-1.9.3-p374 - #compiling.....................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/ash/.rvm/log/1397112910_ruby-1.9.3-p374/make.log
f_rational_new_no_reduce1(VALUE klass, VALUE x)
^
6 warnings generated.
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
regparse.c:582:15: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
    return t->num_entries;
    ~~~~~~ ~~~^~~~~~~~~~~
1 error generated.
make: *** [regparse.o] Error 1
++ return 2
There has been an error while running make. Halting the installation.

Ive also tried rvm install ruby-1.9.3-p374 --with-gcc=clang and rvm install ruby-1.9.3-p374

More info

Path

I am very hazy on what should be in PATH, and in what order. But does my PATH look wrong to anyone?

$ echo $PATH
/usr/local/bin:
/opt/local/bin:
/opt/local/sbin:
/opt/local/bin:
/opt/local/sbin:
/Users/ash/.rvm/gems/ruby-1.9.3-p374/bin:
/Users/ash/.rvm/gems/ruby-1.9.3-p374@global/bin:
/Users/ash/.rvm/rubies/ruby-1.9.3-p374/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:/sbin:
/opt/X11/bin:
/usr/local/git/bin:
/Users/ash/.rvm/bin:
/usr/local/share/npm/bin/

note: linebreaks added for readability

bashrc

$ nano ~/.bashrc
NANO:
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

NODE_PATH="/usr/local/share/npm/lib/node_modules/"
export NODE_PATH

if which ruby >/dev/null && which gem >/dev/null; then
    PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH"
fi

export PATH="/usr/local/share/npm/bin:$PATH"

bash_profile

$ nano ~/.bash_profile
NANO:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

eval "$(rbenv init -)"
export CC=gcc
##
# Your previous /Users/ash/.bash_profile file was backed up as /Users/ash/.bash_profile.macports-saved_2013-09-17_at_15:58:10
##

# MacPorts Installer addition on 2013-09-17_at_15:58:10: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.


[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM

##
# Your previous /Users/ash/.bash_profile file was backed up as /Users/ash/.bash_profile.macports-saved_2014-01-24_at_11:35:53
##

# MacPorts Installer addition on 2014-01-24_at_11:35:53: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.

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

export PATH=$PATH:/usr/local/share/npm/bin

Eww...rvm, rbenv and Macports all mushed together...its just unnatural

GEMS

$ echo $GEMS

empty :(

Rubies

$ rvm list
Warning! PATH is not properly set up, '/Users/ashleycoleman/.rvm/gems/ruby-1.9.3-p374/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-1.9.3-p374'.

rvm rubies


# No rvm rubies installed yet. Try 'rvm help install'.

:'(

I tried installing after running rvm use ruby-1.9.3-p374 but it didn't help

Brew doctor

$ brew doctor
Your system is ready to brew.

:'D

Ashley Coolman
  • 11,095
  • 5
  • 59
  • 81

1 Answers1

1

Just found someone with (probably) your same problem: Installing Ruby on Mac OS X 10.8.2

As you can see, you have the same error in running the rvm install:

regparse.c:582:15: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
return t->num_entries;

as the answer say ( https://stackoverflow.com/a/14663025/1833218 ), try here:

https://gist.github.com/zenkay/3237860

Community
  • 1
  • 1
Antonio Ragagnin
  • 2,278
  • 4
  • 24
  • 39