Ruby on Mint Linux

As some of you will recall I am one of the idiot few running Ruby under Windows, successfully most of the time. However, when staying with my son I get to use a Linux PC (Mint 17). This has Ruby installed as part of the distro. However, I recently tried to update the Gems, so I could do some programming while there but got an error message to the effect that this can not be done as the system has locked down the Ruby installation - I guess this is because the system actually uses Ruby, but wish to know if there is a workaround that will allow the use of Ruby on his system?

···

--
Patrick Bayford Tel : 020 8265 8376 E-mail : pbayford@talktalk.net

The simplest way would be to use RVM (Ruby Version Manager) --
https://rvm.io . Install it by copying the two lines under "Install RVM:"
on that page and pasting them into the terminal. RVM is a utility that
installs one or more versions of Ruby for you (inside your home directory,
so you don't need extra permissions), and lets you switch between them; it
also does a lot of other fancy things, like gemsets (you can have certain
gems visible only while you're working on certain projects). It's pretty
complex under the hood, but for your use case I think it would be the
easiest way to get started; you can ignore the extra stuff.

Besides RVM there are some tools that are considered lighter and/or more
modular; they typically separate out the task of installing from that of
switching. A page with some details and links on these is at
https://gist.github.com/dakull/5895087 .

···

On Mon, Sep 5, 2016 at 2:48 PM, Patrick Bayford <pbayford@talktalk.net> wrote:

As some of you will recall I am one of the idiot few running Ruby under
Windows, successfully most of the time. However, when staying with my son I
get to use a Linux PC (Mint 17). This has Ruby installed as part of the
distro. However, I recently tried to update the Gems, so I could do some
programming while there but got an error message to the effect that this
can not be done as the system has locked down the Ruby installation - I
guess this is because the system actually uses Ruby, but wish to know if
there is a workaround that will allow the use of Ruby on his system?

First thing to understand is how Linux package management systems
work: software is installed for all users of the system. Often there
are packages for certain prominent Gems. These will be maintained and
updated by the package maintainers.

If you want one user to use arbitrary versions of Gems you just need
to configure it so that these Gems are stored in a directory writable
by the user. Command line options --install-dir and --bindir will
help. Even better use environment variables which you set in the
user's ~/.bashrc or similar startup file of the shell. See also "gem
environment".

Further reading
http://guides.rubygems.org/

Kind regards

robert

···

On Mon, Sep 5, 2016 at 9:48 PM, Patrick Bayford <pbayford@talktalk.net> wrote:

As some of you will recall I am one of the idiot few running Ruby under
Windows, successfully most of the time. However, when staying with my son I
get to use a Linux PC (Mint 17). This has Ruby installed as part of the
distro. However, I recently tried to update the Gems, so I could do some
programming while there but got an error message to the effect that this can
not be done as the system has locked down the Ruby installation - I guess
this is because the system actually uses Ruby, but wish to know if there is
a workaround that will allow the use of Ruby on his system?

--
[guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can
- without end}
http://blog.rubybestpractices.com/

This is not a Ruby solution, and is a lot more work, but you may want
to check how much memory you've got. If there is a lot, you could
install vm software like virtualbox (not the best, but tried and true)
and just install Linux on that. Then, anything you do on the
virtualbox will not affect the host machine. There is hyperv on
windows, but that is more expensive. I blew up windows with
virtualbox once, so only use it on Linux, where I have never had a
problem with it.

That being said, rvm is not the only multi-version thing for ruby, and
rbenv is more minimalist, and is used also on professional teams. I
think it is a little better than RVM, but RVM is perfectly good and
works.

···

On Tue, Sep 6, 2016 at 7:44 AM, Eric Christopherson <echristopherson@gmail.com> wrote:

On Mon, Sep 5, 2016 at 2:48 PM, Patrick Bayford <pbayford@talktalk.net> > wrote:

As some of you will recall I am one of the idiot few running Ruby under
Windows, successfully most of the time. However, when staying with my son I
get to use a Linux PC (Mint 17). This has Ruby installed as part of the
distro. However, I recently tried to update the Gems, so I could do some
programming while there but got an error message to the effect that this can
not be done as the system has locked down the Ruby installation - I guess
this is because the system actually uses Ruby, but wish to know if there is
a workaround that will allow the use of Ruby on his system?

The simplest way would be to use RVM (Ruby Version Manager) --
https://rvm.io . Install it by copying the two lines under "Install RVM:" on
that page and pasting them into the terminal. RVM is a utility that installs
one or more versions of Ruby for you (inside your home directory, so you
don't need extra permissions), and lets you switch between them; it also
does a lot of other fancy things, like gemsets (you can have certain gems
visible only while you're working on certain projects). It's pretty complex
under the hood, but for your use case I think it would be the easiest way to
get started; you can ignore the extra stuff.

Besides RVM there are some tools that are considered lighter and/or more
modular; they typically separate out the task of installing from that of
switching. A page with some details and links on these is at
https://gist.github.com/dakull/5895087 .

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Many thanks Eric, and also to Xeno - the virtual machine solution sounds a bit heavyweight for my needs, but I will bear it in mind. The RVM approach sounds like a good starting point!!!

···

On 06/09/2016 3:44 PM, Eric Christopherson wrote:

On Mon, Sep 5, 2016 at 2:48 PM, Patrick Bayford <pbayford@talktalk.net > <mailto:pbayford@talktalk.net>> wrote:

    As some of you will recall I am one of the idiot few running Ruby
    under Windows, successfully most of the time. However, when
    staying with my son I get to use a Linux PC (Mint 17). This has
    Ruby installed as part of the distro. However, I recently tried to
    update the Gems, so I could do some programming while there but
    got an error message to the effect that this can not be done as
    the system has locked down the Ruby installation - I guess this is
    because the system actually uses Ruby, but wish to know if there
    is a workaround that will allow the use of Ruby on his system?

The simplest way would be to use RVM (Ruby Version Manager) -- https://rvm.io . Install it by copying the two lines under "Install RVM:" on that page and pasting them into the terminal. RVM is a utility that installs one or more versions of Ruby for you (inside your home directory, so you don't need extra permissions), and lets you switch between them; it also does a lot of other fancy things, like gemsets (you can have certain gems visible only while you're working on certain projects). It's pretty complex under the hood, but for your use case I think it would be the easiest way to get started; you can ignore the extra stuff.

Besides RVM there are some tools that are considered lighter and/or more modular; they typically separate out the task of installing from that of switching. A page with some details and links on these is at https://gist.github.com/dakull/5895087 .

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 2016.0.7752 / Virus Database: 4649/12952 - Release Date: 09/05/16

--
Patrick Bayford Tel : 020 8265 8376 E-mail : pbayford@talktalk.net

Thanks for that Robert -I will add that to the tips from the others!
As you may have guessed from the question, a large part of my problem is lack of familiarity with Linux !!!

···

On 08/09/2016 1:07 PM, Robert Klemme wrote:

On Mon, Sep 5, 2016 at 9:48 PM, Patrick Bayford <pbayford@talktalk.net> wrote:

As some of you will recall I am one of the idiot few running Ruby under
Windows, successfully most of the time. However, when staying with my son I
get to use a Linux PC (Mint 17). This has Ruby installed as part of the
distro. However, I recently tried to update the Gems, so I could do some
programming while there but got an error message to the effect that this can
not be done as the system has locked down the Ruby installation - I guess
this is because the system actually uses Ruby, but wish to know if there is
a workaround that will allow the use of Ruby on his system?

First thing to understand is how Linux package management systems
work: software is installed for all users of the system. Often there
are packages for certain prominent Gems. These will be maintained and
updated by the package maintainers.

If you want one user to use arbitrary versions of Gems you just need
to configure it so that these Gems are stored in a directory writable
by the user. Command line options --install-dir and --bindir will
help. Even better use environment variables which you set in the
user's ~/.bashrc or similar startup file of the shell. See also "gem
environment".

Further reading
http://guides.rubygems.org/
http://unix.stackexchange.com/questions/203376/how-to-set-ruby-gem-home-and-gem-path

Kind regards

robert

--
Patrick Bayford Tel : 020 8265 8376 E-mail : pbayford@talktalk.net

In fact, I've just checked out Robert's suggestions, and the second almost mimics my problem, so I am hopeful that will provide a relatively simple solution. Thanks.

···

On 08/09/2016 10:31 PM, Patrick Bayford wrote:

On 08/09/2016 1:07 PM, Robert Klemme wrote:

On Mon, Sep 5, 2016 at 9:48 PM, Patrick Bayford<pbayford@talktalk.net> wrote:

As some of you will recall I am one of the idiot few running Ruby under
Windows, successfully most of the time. However, when staying with my son I
get to use a Linux PC (Mint 17). This has Ruby installed as part of the
distro. However, I recently tried to update the Gems, so I could do some
programming while there but got an error message to the effect that this can
not be done as the system has locked down the Ruby installation - I guess
this is because the system actually uses Ruby, but wish to know if there is
a workaround that will allow the use of Ruby on his system?

First thing to understand is how Linux package management systems
work: software is installed for all users of the system. Often there
are packages for certain prominent Gems. These will be maintained and
updated by the package maintainers.

If you want one user to use arbitrary versions of Gems you just need
to configure it so that these Gems are stored in a directory writable
by the user. Command line options --install-dir and --bindir will
help. Even better use environment variables which you set in the
user's ~/.bashrc or similar startup file of the shell. See also "gem
environment".

Further reading
http://guides.rubygems.org/
http://unix.stackexchange.com/questions/203376/how-to-set-ruby-gem-home-and-gem-path

Kind regards

robert

Thanks for that Robert -I will add that to the tips from the others!
As you may have guessed from the question, a large part of my problem is lack of familiarity with Linux !!!

--
Patrick Bayford Tel : 020 8265 8376 E-mail : pbayford@talktalk.net

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 2016.0.7752 / Virus Database: 4649/12966 - Release Date: 09/07/16

--
Patrick Bayford Tel : 020 8265 8376 E-mail : pbayford@talktalk.net