3

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.

    genericuser@genericserver.com [~/railsapp]# which bundle
    /home/genericuser/.rvm/gems/ruby-1.9.2-p320@railsapp/bin/bundle
    genericuser@genericserver.com [~/railsapp]# which ruby
    /home/genericuser/.rvm/bin/ruby
    genericuser@genericserver.com [~/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
    genericuser@genericserver.com [~/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

    genericuser@genericserver.com [~]# 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]
eckc
  • 488
  • 6
  • 13
  • could you try? `rvm use 1.9.2 --default` then `ruby -v` – amalrik maia May 03 '13 at 14:12
  • As seem [here](https://rvm.io/rvm/install/) please try: `type rvm | head -1` if does not show "rvm is a function", RVM isn't being sourced correctly. – amalrik maia May 03 '13 at 15:11
  • @amalrikmaia Thanks for the suggestions! ruby -v still gives me the `Argument list too long` error, which I'm still stumped on for the time being. I have added the result for `rvm | head -1` however. – eckc May 03 '13 at 19:30

1 Answers1

1

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

Community
  • 1
  • 1
Arvind
  • 2,671
  • 1
  • 18
  • 32
  • Hi Arv, that link does indeed have some resemblance, but isn't quite identical. I will try to stumble about a while longer before asking the admin to re-install RVM, it's a good learning experience anyway haha. The admin did mention he couldn't update Ruby system-wide, I'm not sure if that's a factor... anyways, this will be my backup plan, thank you! – eckc May 03 '13 at 19:34
  • 1
    Hi again, it's been a few days and unfortunately deadline looms. We're forced to skip meddling around and go straight to reinstalling. I've marked your answer as a solution, but unfortunately I don't have enough reputation to mark it as useful, too. Thanks though. =) – eckc May 07 '13 at 02:27