Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Ruby on Rails

  1. #1

    Cool Ruby on Rails

    Sign me up!

    -taresaco

  2. #2
    Join Date
    Feb 2006
    Posts
    177

    Default

    Send an email to rando@bluehost.com with your domain name and I'll get you moved over to box85 so you can test it.

  3. #3

    Default What am I doing wrong...

    Is anyone else using Ruby? I tried this:

    taresaco@taresa.com [~]# ls -la calc.rb
    -rw-r--r-- 1 taresaco taresaco 8 Feb 9 16:09 calc.rb
    taresaco@taresa.com [~]# ruby calc.rb
    -bash: ruby: command not found

    calc.rb is just one line:

    puts 1+2

    Maybe I'm looking at the wrong Ruby tutorial. Has anyone else had success?

  4. #4
    Join Date
    Feb 2006
    Posts
    177

    Default

    Ruby isn't in your path for some reason. It's installed to /usr/local/bin/ruby.

  5. #5

    Default

    taresaco@taresa.com [~]# cd usr/local/bin/ruby
    -bash: cd: usr/local/bin/ruby: No such file or directory

    Que?

  6. #6

    Default

    If I need to tell bash where Ruby is... I'm not really sure how to do that, but I'll look it up. Is that the case?

  7. #7
    Join Date
    Feb 2006
    Location
    Fort Washington, PA
    Posts
    16

    Default

    That last ruby is the executable, not another directory. Try entering:

    /usr/local/bin/ruby calc.rb

    Presuming that works, enter the following:

    echo $PATH

    I assume /usr/local/bin won't be in the listed directories.

    Edit (with something simple like pico or vi) the .bash_profile file in your homedir and on the end of the PATH line, add (without quotes) ":/usr/local/bin"

    So for example, it might read:

    PATH=$PATH:$HOME/bin

    make that:

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

    Then either source .bash_profile or simple log out and back in. Presuming the executable is where Rando says it is AND you have the appropriate access rights, that should make it work normally for you.

    --DrSuSE

  8. #8
    Join Date
    Feb 2006
    Location
    Metro DC, United States
    Posts
    100

    Default

    Quote Originally Posted by Taresa
    taresaco@taresa.com [~]# cd usr/local/bin/ruby
    -bash: cd: usr/local/bin/ruby: No such file or directory

    Que?
    A couple things here...

    First, you're missing the leading '/'. You're telling the cd command to go to the usr directory under your current working directory as opposed to the system usr directory. Second, you can't cd to that anyway (it'll throw another error) because it's not a directory. If you want to see if the ruby executable is really there, try 'ls /usr/local/bin | grep ruby'.

    Quote Originally Posted by Taresa
    If I need to tell bash where Ruby is... I'm not really sure how to do that, but I'll look it up. Is that the case?
    If you need to tell bash about /usr/local/bin, put the following line in your ~/.bashrc (and your ~/.bash_profile if you don't have that pointing at your .bashrc):
    Code:
    PATH=/usr/local/bin:${PATH}; export PATH
    Here's a decent intro to bash. Environment settings are dealt with briefly towards the bottom of the page. And here's a link to a bash quick reference card (well, cards).


    Edit: Looks like DrSuSE beat me to it. That's what happens when you're interrupted halfway through writing a post. :)
    Eric :)
    ----
    "If you want to know what a man's like, take a good look at how he treats his inferiors, not his equals."
    ~Sirius Black, Harry Potter and the Goblet of Fire

  9. #9

    Default

    DrSUSE:

    taresaco@taresa.com [~]# /usr/local/bin/ruby calc.rb
    -bash: /usr/local/bin/ruby: No such file or directory

    Macgyver2:

    taresaco@taresa.com [~]# cd /usr/local/bin/ruby
    -bash: cd: /usr/local/bin/ruby: No such file or directory

    It's been too long since I've edited a shell.

    I'll try editing my .bashes now. Thanks guys! I'll post what happens.

  10. #10
    Join Date
    Feb 2006
    Location
    Fort Washington, PA
    Posts
    16

    Default

    Taresa,

    If you're getting: "/usr/local/bin/ruby: No such file or directory" then either ruby isn't there or there's some sort of privelages type situation going on. Sounds like you're going to need BH to doublecheck the location for you.

    --DrSuSE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •