Following the installation process for rvm and ruby found here @
http://rvm.io/ I installed rvm and ruby to a home directory of a user I use to administer a ruby web application (Diaspora).
From a user that has permission I can navigate to the directory and issue the following commands to get a ruby started..
Code:
source /home/user/.rvm/scripts/rvm
Code:
rvm use ruby-2.0.0-p353
ruby --version spits out the version of ruby I decided to use from any directory after this point.
I then switch users and issue the following
This spits out
I do not remember installing a system copy of ruby
and don't want it. I then
Code:
apt-get remove ruby
it spits out
"removing libraries exc.. please apt-get autoremove
to remove a half dozen or so listed items"
I abide to the request
just to be sure it is gone I issue
Code:
apt-get remove ruby
spits out not installed nothing to remove..
This is curious though as I issue ruby --version
and it spits outs
ok so now I am confused, did I install (configure && make && make install) at some point..
I still want to remove this thing...
Curious I : issue the following
Code:
update-alternatives --config ruby
this spits out no alternatives but the one ruby1.8.7
-- My goal is to update the ruby I have installed globally --
So I continue issuing commands
Code:
cd /opt/ && mkdir ruby && cd ruby
Code:
curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz | tar xz
ok it is installed, lets test
spits out
curious and concerned about being able to
uninstall things later I do a quick google search
then make install again a little different
Code:
apt-get install checkinstall
prompts to change summary, and errors because
letters are not allowed in the version number
I do the whole process again, modify summary and
remove the letter from the version number.
Output says yay installed - ruby binary is at
ok so now I am a little bit flustered..
#why couldn't binary have installed to
Code:
/usr/local/ruby/ruby2.0.0/bin/ruby
#why couldn't libraries installed to
Code:
/usr/local/ruby/ruby2.0.0/lib/*
My question is what are all the binaries that install for ruby, the two I know are gem and ruby
I then enter these binaries in
Code:
update-alternatives --install /usr/bin/ruby ruby /usr/local/bin/ruby 1 && update-alternatives --install /usr/bin/gem ruby /usr/local/bin/gem 1
the fore-mentioned locations for these two binaries may not be correct as I am writing from my recollection.
I then issue a couple of
Code:
update-alternatives --config ruby
select my version of ruby, then issue
spits out
Code:
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
yay, now what...
I have a few questions,
1. when I issue: rvm use rubyXXXpXXX from the home directory where it is installed, with a user that is granted access of course, any directory I issue ruby --version from, now: ignores the local installed ruby and outputs the one I just started using with the previous command, how does it do that and how does my shell know where to find the correct binary?
2. When issuing the rvm use statement that it is starting with such and such gemset that I have installed specific to diaspora in that home directory..
3. What I want to do is: maintain clean separation between application specific libraries gems exc.. and local-system libraries, binaries, gems exc... that can be used by all of these applications..
I am a newb to much of ruby, how do I remove that old 1.8.7 ruby and what constitutes the seperation of ruby and gems..
I did a quick start with ruby on linux, now I feel it important to dig a little deeper so I know what is going on, when I gem install rake with the local-system ruby where is it going to be placed, and how does ruby know where that location is, should I permanently add a location to PATH such as "/usr/local/ruby/latest/bin" ?
I thought about moving my rvm install to the local directory and adding it's commands to /usr/bin with update-alternatives install or just ln -s
what is a good approach with security and separation of logic, data and static / less likely to change scripts in mind..