Help with Ruby.

Search This thread

FurySh0ck

Senior Member
Oct 15, 2016
59
5
Hello friends! I post this on the off to pic because I can't really find a fitting sub-forum. If you know a better place I can post this thread, please let me know.
I want ruby and Ruby gems to run on my android device (galaxy S4 GT-I9515, not that it matters). I know android is Linux based so there shouldn't be a problem doing this.
Basically, I don't want to use Ruby for development, I just need to use some of it's applications (gems).
I tried ruboto core and ruboto IRB, but couldn't install a gem.

In general, my android won't read "apt-get" command in terminal. I don't know why.
If anyone could help me to run some Ruby gems on my device, I would really appreciate it. Thanks for people who answer!
 
Android is a Linux kernel, however it is not a full Linux like Debian or Ubuntu.
Android doesn't have a package manager by default (unless with Google Play or other app markets). It doesn't have apt-get.
However, I can say that there's a terminal called Termux in Google Play or F-Droid.
It does have apt and it doesn't require root.
I found Ruby in the apt repos of Termux though.
Code:
$ apt list | grep ruby

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

ruby/stable 2.3.3 arm
ruby-dev/stable 2.3.3 arm
ruby-ri/stable 2.3.3 all
weechat-ruby-plugin/stable 1.6-1 arm
 
Last edited:
  • Like
Reactions: FurySh0ck

FurySh0ck

Senior Member
Oct 15, 2016
59
5
Android is a Linux kernel, however it is not a full Linux like Debian or Ubuntu.
Android doesn't have a package manager by default (unless with Google Play or other app markets). It doesn't have apt-get.
However, I can say that there's a terminal called Termux in Google Play or F-Droid.
It does have apt and it doesn't require root.
I found Ruby in the apt repos of Termux though.
Code:
$ apt list | grep ruby

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

ruby/stable 2.3.3 arm
ruby-dev/stable 2.3.3 arm
ruby-ri/stable 2.3.3 all
weechat-ruby-plugin/stable 1.6-1 arm

First of all thanks for the reply!
So, in order to use ruby on android all I have to do is use a more linux-like terminal, and use the command "$ apt list | grep ruby", am I right?
Will I have access to apt-get and commands like that with the new terminal?
 
Android is a Linux kernel, however it is not a full Linux like Debian or Ubuntu.
Android doesn't have a package manager by default (unless with Google Play or other app markets). It doesn't have apt-get.
However, I can say that there's a terminal called Termux in Google Play or F-Droid.
It does have apt and it doesn't require root.
I found Ruby in the apt repos of Termux though.


First of all thanks for the reply!
So, in order to use ruby on android all I have to do is use a more linux-like terminal, and use the command "$ apt list | grep ruby", am I right?
Will I have access to apt-get and commands like that with the new terminal?

Termux is not really more Linux like, it's still using the same kernel. It downloads a core (other applications, etc) to /data folder. That's how it works.
You will have access to apt in the new terminal. However, there is not much packages in the repo as your Android device is ARM and the packages have to be built into a package file. If you'd like the full experience, consider using a KVM or Xen VPS which run full on distributions (Debian, Ubuntu, etc). They also have more packages over there.
Now to install Ruby, you wouldn't apt list. What you would do in Termux:
Code:
apt install ruby
would install Ruby and you would be able to use it and install gems.
I installed Ruby with that command and confirmed it works:
Code:
$ apt install ruby
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  ruby
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 3587 kB of archives.
After this operation, 18.3 MB of additional disk space will be used.
Get:1 [url]http://termux.net[/url] stable/main arm ruby arm 2.3.3 [3587 kB]
Fetched 3587 kB in 1s (2878 kB/s)
Selecting previously unselected package ruby.
(Reading database ... 2137 files and directories currently installed.)
Preparing to unpack .../archives/ruby_2.3.3_arm.deb ...
Unpacking ruby (2.3.3) ...
Processing triggers for man (1.13.4-3) ...
Setting up ruby (2.3.3) ...
When I ran the
Code:
gem
command I got this:
Code:
$ gem
RubyGems is a sophisticated package manager for Ruby.  This is a
basic help message containing pointers to more information.

  Usage:
    gem -h/--help
    gem -v/--version
    gem command [arguments...] [options...]

  Examples:
    gem install rake
    gem list --local
    gem build package.gemspec
    gem help install

  Further help:
    gem help commands            list all 'gem' commands
    gem help examples            show some examples of usage
    gem help gem_dependencies    gem dependencies file guide
    gem help platforms           gem platforms guide
    gem help <COMMAND>           show help on COMMAND
                                   (e.g. 'gem help install')
    gem server                   present a web page at
                                 [url]http://localhost:8808/[/url]
                                 with info about installed gems
  Further information:
    [url]http://guides.rubygems.org[/url]

Enjoy!
 
  • Like
Reactions: FurySh0ck

FurySh0ck

Senior Member
Oct 15, 2016
59
5
Termux is not really more Linux like, it's still using the same kernel. It downloads a core (other applications, etc) to /data folder. That's how it works.
You will have access to apt in the new terminal. However, there is not much packages in the repo as your Android device is ARM and the packages have to be built into a package file. If you'd like the full experience, consider using a KVM or Xen VPS which run full on distributions (Debian, Ubuntu, etc). They also have more packages over there.
Now to install Ruby, you wouldn't apt list. What you would do in Termux:
Code:
apt install ruby
would install Ruby and you would be able to use it and install gems.
I installed Ruby with that command and confirmed it works:
Code:
$ apt install ruby
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  ruby
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 3587 kB of archives.
After this operation, 18.3 MB of additional disk space will be used.
Get:1 [url]http://termux.net[/url] stable/main arm ruby arm 2.3.3 [3587 kB]
Fetched 3587 kB in 1s (2878 kB/s)
Selecting previously unselected package ruby.
(Reading database ... 2137 files and directories currently installed.)
Preparing to unpack .../archives/ruby_2.3.3_arm.deb ...
Unpacking ruby (2.3.3) ...
Processing triggers for man (1.13.4-3) ...
Setting up ruby (2.3.3) ...
When I ran the
Code:
gem
command I got this:
Code:
$ gem
RubyGems is a sophisticated package manager for Ruby.  This is a
basic help message containing pointers to more information.

  Usage:
    gem -h/--help
    gem -v/--version
    gem command [arguments...] [options...]

  Examples:
    gem install rake
    gem list --local
    gem build package.gemspec
    gem help install

  Further help:
    gem help commands            list all 'gem' commands
    gem help examples            show some examples of usage
    gem help gem_dependencies    gem dependencies file guide
    gem help platforms           gem platforms guide
    gem help <COMMAND>           show help on COMMAND
                                   (e.g. 'gem help install')
    gem server                   present a web page at
                                 [url]http://localhost:8808/[/url]
                                 with info about installed gems
  Further information:
    [url]http://guides.rubygems.org[/url]

Enjoy!

Awesome! It worked well and neat. +1 For your Thanks-o'-meter.
Now I have some questions about termux, if you could answer:
1) Where does it save all the files? I used
Code:
 apt update
and I am going to download packages from now on. I think I should know where it goes / how can I change that save directory.
2) When I tried using root permissions (you know, my device is rooted so I used
Code:
 su
in order to gain access) I couldn't use apt commands anymore. I think some of my ruby gems will require root permissions, so I would like further explanation about it (only if you could of course :D)
 
Termux is not really more Linux like, it's still using the same kernel. It downloads a core (other applications, etc) to /data folder. That's how it works.
You will have access to apt in the new terminal. However, there is not much packages in the repo as your Android device is ARM and the packages have to be built into a package file. If you'd like the full experience, consider using a KVM or Xen VPS which run full on distributions (Debian, Ubuntu, etc). They also have more packages over there.
Now to install Ruby, you wouldn't apt list. What you would do in Termux:

would install Ruby and you would be able to use it and install gems.
I installed Ruby with that command and confirmed it works:

When I ran the command I got this:


Awesome! It worked well and neat. +1 For your Thanks-o'-meter.
Now I have some questions about termux, if you could answer:
1) Where does it save all the files? I used and I am going to download packages from now on. I think I should know where it goes / how can I change that save directory.
2) When I tried using root permissions (you know, my device is rooted so I used in order to gain access) I couldn't use apt commands anymore. I think some of my ruby gems will require root permissions, so I would like further explanation about it (only if you could of course :D)

1. It saves inside app data, specific folder is /data/data/com.termux/files/usr/var/cache/apt
2. I don't think su works in Termux really, however my root doesn't work right now so I can't really say a definite answer.
 
  • Like
Reactions: FurySh0ck

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Android is a Linux kernel, however it is not a full Linux like Debian or Ubuntu.
    Android doesn't have a package manager by default (unless with Google Play or other app markets). It doesn't have apt-get.
    However, I can say that there's a terminal called Termux in Google Play or F-Droid.
    It does have apt and it doesn't require root.
    I found Ruby in the apt repos of Termux though.
    Code:
    $ apt list | grep ruby
    
    WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
    
    ruby/stable 2.3.3 arm
    ruby-dev/stable 2.3.3 arm
    ruby-ri/stable 2.3.3 all
    weechat-ruby-plugin/stable 1.6-1 arm
    1
    Android is a Linux kernel, however it is not a full Linux like Debian or Ubuntu.
    Android doesn't have a package manager by default (unless with Google Play or other app markets). It doesn't have apt-get.
    However, I can say that there's a terminal called Termux in Google Play or F-Droid.
    It does have apt and it doesn't require root.
    I found Ruby in the apt repos of Termux though.


    First of all thanks for the reply!
    So, in order to use ruby on android all I have to do is use a more linux-like terminal, and use the command "$ apt list | grep ruby", am I right?
    Will I have access to apt-get and commands like that with the new terminal?

    Termux is not really more Linux like, it's still using the same kernel. It downloads a core (other applications, etc) to /data folder. That's how it works.
    You will have access to apt in the new terminal. However, there is not much packages in the repo as your Android device is ARM and the packages have to be built into a package file. If you'd like the full experience, consider using a KVM or Xen VPS which run full on distributions (Debian, Ubuntu, etc). They also have more packages over there.
    Now to install Ruby, you wouldn't apt list. What you would do in Termux:
    Code:
    apt install ruby
    would install Ruby and you would be able to use it and install gems.
    I installed Ruby with that command and confirmed it works:
    Code:
    $ apt install ruby
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
      ruby
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 3587 kB of archives.
    After this operation, 18.3 MB of additional disk space will be used.
    Get:1 [url]http://termux.net[/url] stable/main arm ruby arm 2.3.3 [3587 kB]
    Fetched 3587 kB in 1s (2878 kB/s)
    Selecting previously unselected package ruby.
    (Reading database ... 2137 files and directories currently installed.)
    Preparing to unpack .../archives/ruby_2.3.3_arm.deb ...
    Unpacking ruby (2.3.3) ...
    Processing triggers for man (1.13.4-3) ...
    Setting up ruby (2.3.3) ...
    When I ran the
    Code:
    gem
    command I got this:
    Code:
    $ gem
    RubyGems is a sophisticated package manager for Ruby.  This is a
    basic help message containing pointers to more information.
    
      Usage:
        gem -h/--help
        gem -v/--version
        gem command [arguments...] [options...]
    
      Examples:
        gem install rake
        gem list --local
        gem build package.gemspec
        gem help install
    
      Further help:
        gem help commands            list all 'gem' commands
        gem help examples            show some examples of usage
        gem help gem_dependencies    gem dependencies file guide
        gem help platforms           gem platforms guide
        gem help <COMMAND>           show help on COMMAND
                                       (e.g. 'gem help install')
        gem server                   present a web page at
                                     [url]http://localhost:8808/[/url]
                                     with info about installed gems
      Further information:
        [url]http://guides.rubygems.org[/url]

    Enjoy!
    1
    Termux is not really more Linux like, it's still using the same kernel. It downloads a core (other applications, etc) to /data folder. That's how it works.
    You will have access to apt in the new terminal. However, there is not much packages in the repo as your Android device is ARM and the packages have to be built into a package file. If you'd like the full experience, consider using a KVM or Xen VPS which run full on distributions (Debian, Ubuntu, etc). They also have more packages over there.
    Now to install Ruby, you wouldn't apt list. What you would do in Termux:

    would install Ruby and you would be able to use it and install gems.
    I installed Ruby with that command and confirmed it works:

    When I ran the command I got this:


    Awesome! It worked well and neat. +1 For your Thanks-o'-meter.
    Now I have some questions about termux, if you could answer:
    1) Where does it save all the files? I used and I am going to download packages from now on. I think I should know where it goes / how can I change that save directory.
    2) When I tried using root permissions (you know, my device is rooted so I used in order to gain access) I couldn't use apt commands anymore. I think some of my ruby gems will require root permissions, so I would like further explanation about it (only if you could of course :D)

    1. It saves inside app data, specific folder is /data/data/com.termux/files/usr/var/cache/apt
    2. I don't think su works in Termux really, however my root doesn't work right now so I can't really say a definite answer.