LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-11-2014, 06:02 PM   #1
Corpus-Khu
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Rep: Reputation: Disabled
RVM + local install ruby + system ruby maintenance


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
Code:
ruby --version
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
Code:
ruby --version
This spits out
Code:
ruby1.8.7
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
Code:
apt-get autoremove
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
Code:
ruby --version
and it spits outs
Code:
ruby1.8.7
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
Code:
cd ruby-2.0.0-p247
Code:
./configure
Code:
make
Code:
make install
ok it is installed, lets test
Code:
ruby --version
spits out
Code:
ruby-1.8.7
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
Code:
./configure
Code:
make
Code:
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
Code:
/usr/local/bin
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
Code:
ruby --version
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..

Last edited by Corpus-Khu; 02-11-2014 at 06:58 PM. Reason: syntax
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any issues installing Ruby Gems and Ruby on Rails in Slackware? Lufbery Slackware 8 02-09-2011 08:22 PM
Ruby SDL/ Ruby OpenGL tutorials/reference? LinuxNoob75 Programming 0 12-30-2007 01:47 PM
PHP v Ruby/Ruby on Rails Neko_D Linux - General 4 02-09-2007 12:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration