Raspberry Pi + Ruby, Rails, Bundler

Raspberry Pi Experimenting Woes

I was trying to install rails on my Raspberry Pi which I just have running 3.6.11+ of the pi tailored Debian named Raspbian and left it alone compiling and installing Ruby 2.0, and Rails 3.2.11 and 4.0.

I was able to run irb and do basic ruby stuff which is great, but wasn’t sure if anyone could lend a hand as I am having trouble running Bundler and Rails.

Rails is not found when typed from the command line and Bundler gives me ‘/home/pi/.rvm/bin/bundle: line 32: gem: command not found’ I did some digging on stack overflow but all I got out of it which I tried was checking my $PATH, running rvm get head && rvm reload, rvm gemset use global && gem install bundler, and I havn’t had any luck.

uname -a
(in addition I added the info from sudo cat /proc/version)
Linux raspberrypi 3.6.11+ (dc4@dc4-arm-01) (gcc version 4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - Linaro GCC 2012.08) ) #474 PREEMPT Thu Jun 13 17:14:42 BST 2013

which ruby
/home/pi/.rvm/bin/ruby

which bundle
/home/pi/.rvm/bin/bundle

which rails
no response

gem list --local

actionmailer (4.0.0, 3.2.11)
actionpack (4.0.0, 3.2.11)
activemodel (4.0.0, 3.2.11)
activerecord (4.0.0, 3.2.11)
activerecord-deprecated_finders (1.0.3)
activeresource (3.2.11)
activesupport (4.0.0, 3.2.11)
arel (4.0.0, 3.0.2)
atomic (1.1.10)
bigdecimal (1.2.0)
builder (3.1.4, 3.0.4)
bundle (0.0.1)
bundler (1.3.5)
bundler-unload (1.0.1)
erubis (2.7.0)
hike (1.2.3)
i18n (0.6.4)
io-console (0.4.2)
journey (1.0.4)
json (1.7.7)
mail (2.5.4, 2.4.4)
mime-types (1.23)
minitest (4.3.2)
multi_json (1.7.7)
polyglot (0.3.3)
psych (2.0.0)
rack (1.5.2, 1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (4.0.0, 3.2.11)
railties (4.0.0, 3.2.11)
rake (10.1.0, 0.9.6)
rdoc (4.0.0, 3.12.2)
rubygems-bundler (1.2.1)
rvm (1.11.3.8)
sprockets (2.10.0, 2.2.2)
sprockets-rails (2.0.0)
test-unit (2.0.0.0)
thor (0.18.1)
thread_safe (0.1.0)
tilt (1.4.1)
treetop (1.4.14)
tzinfo (0.3.37)

Thanks in advance to anyone who has any ideas.

If I can’t figure it out I try to switch it to Arch and just start again, but i’m really thinking this is probably something I just haven’t ever encountered before and may be resolvable given a nudge in the right direction.

Thanks,

Adam Faur

The rvm installer puts different things in your .bashrc and .bash_profile files, which means it is loaded differently in login shells and interactive shells.

Try running rvm use default. If you get a message telling you “RVM is not a function, selecting rubies with ‘rvm use …’ will not work” then you’re not in a login shell.

According to a blog post called “Bundler and rvm: remember about login shell” not running in a login shell can also cause the issue you’re seeing, although I’ve not been able to replicate it here.

Hopefully that’s put you on the right track. Good luck!

1 Like

You are awesome!!

Thanks for this,
For anyone who is wondering I simply had to run /bin/bash --login
I wasn’t inside a bash shell by default and didn’t realize it.

I’m just not that clever but thankfully George Brock stopped by to save the day.

Thanks,

Adam Faur

I have nothing of utility to add beyond @georgebrock ’ s awesomeness except to point out GitHub - djcp/pigal: A Raspberry pi optimized full-screen gallery program, a sinatra image gallery app I wrote that might give you some ideas.