Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run pry on Debian Linux for ARM

I installed rvm and Ruby 1.9.3p194 on a Raspberry Pi using Debian Linux. When I installed pry using gem install pry, everything installed perfectly but typing pry in a terminal didn't work:

pi@raspberrypi ~ $ pry
bash: pry: command not found

there's a pry file in ~/.rvm/gems/ruby-1.9.3-p194/bin. I have to call it with ruby_noexec_wrapper in the same directory:

pi@raspberrypi ~ $ .rvm/gems/ruby-1.9.3-p194/bin/pry
/usr/bin/env: ruby_noexec_wrapper: No such file or directory
pi@raspberrypi ~ $ cd .rvm/gems/ruby-1.9.3-p194/bin
pi@raspberrypi ~/.rvm/gems/ruby-1.9.3-p194/bin $ ./ruby_noexec_wrapper pry
[1] pry(main)>

What's the proper way to run pry in this Linux? On Windows and Mac OS X I can simply type pry at any command prompt or terminal.

UPDATE: Here's my rvm info:

pi@raspberrypi ~/.rvm/gems/ruby-1.9.3-p194/bin $ rvm info

ruby-1.9.3-p194:

  system:
    uname:       "Linux raspberrypi 3.1.9+ #168 PREEMPT Sat Jul 14 18:56:31 BST 2012 armv6l GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.2.20(1)-release (arm-unknown-linux-gnueabihf)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.14.10 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]"
    updated:      "1 day 23 hours 36 minutes 30 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p194"
    date:         "2012-04-20"
    platform:     "armv6l-linux-eabi"
    patchlevel:   "2012-04-20 revision 35410"
    full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [armv6l-linux-eabi]"

  homes:
    gem:          "/home/pi/.rvm/gems/ruby-1.9.3-p194"
    ruby:         "/home/pi/.rvm/rubies/ruby-1.9.3-p194"

  binaries:
    ruby:         "/home/pi/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
    irb:          "/home/pi/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
    gem:          "/home/pi/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
    rake:         "/home/pi/.rvm/gems/ruby-1.9.3-p194@global/bin/rake"

  environment:
    PATH:         "/home/pi/.rvm/gems/ruby-1.9.3-p194/bin:/home/pi/.rvm/gems/ruby-1.9.3-p194@global/bin:/home/pi/.rvm/rubies/ruby-1.9.3-p194/bin:/home/pi/.rvm/bin:/usr/lib/arm-linux-gnueabihf/libfm:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
    GEM_HOME:     "/home/pi/.rvm/gems/ruby-1.9.3-p194"
    GEM_PATH:     "/home/pi/.rvm/gems/ruby-1.9.3-p194:/home/pi/.rvm/gems/ruby-1.9.3-p194@global"
    MY_RUBY_HOME: "/home/pi/.rvm/rubies/ruby-1.9.3-p194"
    IRBRC:        "/home/pi/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
    RUBYOPT:      ""
    gemset:       ""
like image 947
at. Avatar asked Nov 13 '22 00:11

at.


1 Answers

first make sure rvm is loaded properly:

type rvm | head -n 1 # should be: rvm is a function
type gem | head -n 1 # should be: gem is a function

if they are not functions this means RVM is not properly loaded, this could be a bug in your shell (like limited bash), you can try to fix it with:

rvm get head --auto

It might be required to relogin after this command to run all shell configuration files.

next, make sure you use rvm:

rvm use 1.9.3
echo $PATH
echo $GEM_PATH # those two need match those from `rvm info`
rvm info

you can also set one ruby to be default:

rvm use 1.9.3 --default

refreshing PATH - type in terminal

hash -r # OR:
PATH="$PATH"

or even relogin should help for this.

like image 169
mpapis Avatar answered Dec 20 '22 03:12

mpapis