eckc
eckc

Reputation: 608

Rvm current and ruby-v not matching, $PATH errors?

I'm working on an RoR app, and I do not have sudo access to the server (CloudLinux Server release 6.3).

The server uses cPanel 11.36 which does not support Rails 3.x, so the admin used Passenger to set up Rails for me. However, system Ruby was still at 1.8.7, and later on the admin used RVM and got 1.9.2.

My problem is, when I type rvm current I see it's using 1.9.2. However, while trying to install gems through bundle install I'm being told that ruby version >= 1.9.2 is required. Typing ruby -v still showed 1.8.7.

After messing with .bashrc and .bash_profile, I think I made things worse, because now if I type ruby -v I'm hit with an Argument list too long error.

    [email protected] [~/railsapp]# which bundle
    /home/genericuser/.rvm/gems/ruby-1.9.2-p320@railsapp/bin/bundle
    [email protected] [~/railsapp]# which ruby
    /home/genericuser/.rvm/bin/ruby
    [email protected] [~/railsapp]# ruby -v
    /home/genericuser/.rvm/bin/ruby: line 6: /home/genericuser/.rvm/bin/ruby: Argument list too long
    /home/genericuser/.rvm/bin/ruby: line 6: /home/genericuser/.rvm/bin/ruby: Success
    [email protected] [~/railsapp]#

Typing $PATH shows:

    bash: /home/genericuser/.rvm/gems/ruby-1.9.2-p320@railsapp/bin:
    /home/genericuser/.rvm/gems/ruby-1.9.2-p320@global/bin:
    /home/genericuser/.rvm/rubies/ruby-1.9.2-p320/bin:
    /home/genericuser/.rvm/bin:
    /usr/local/jdk/bin:
    /home/genericuser/perl5/bin:
    /usr/local/bin:
    /bin:
    /usr/bin:
    /usr/local/sbin:
    /usr/sbin:
    /sbin:
    /usr/X11R6/bin:
    /home/genericuser/bin: No such file or directory

.bashrc is:

    # .bashrc

    # Source global definitions
    if [ -f /etc/bashrc ]; then
        . /etc/bashrc
    fi

    # User specific aliases and functions

    PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting

.bash_profile is:

    # .bash_profile

    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
        . ~/.bashrc
    fi

    # User specific environment and startup programs

    PATH=$PATH:$HOME/bin

    export PATH

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

I'm not too sure where the problem is, and having read a bunch of other questions about $PATH and installing RVM I feel like I'm even more lost since nothing seemed to help thus far. I'd guess there is more than one problem, but $PATH seems a good start? I am fairly certain I messed up the init files because I was adding and deleting lines from many different questions on here. Any pointers would be greatly appreciated, thank you.

EDIT

    [email protected] [~]# rvm | head -1
    {Master: <img src="https://secure.travis-ci.org/wayneeseguin/rvm.png?branch=master"  alt="Build Status" /> 
    Stable:<img src="https://secure.travis-ci.org/wayneeseguin/rvm.png?branch=stable" alt="Build Status" />}
    [https://travis-ci.org/wayneeseguin/rvm/branches]

Upvotes: 3

Views: 1015

Answers (1)

Arvind
Arvind

Reputation: 2781

This is due to rvm not being installed properly. Uninstall it and reinstall using the instructions here.

This question has a similar issue: Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v

Upvotes: 1

Related Questions