Getting Started With Development

I'm new to Ruby Development. I downloaded source from Github, but couldn't
build it. Can somebody tell me where I can download a ruby-lang source that
can be compiled and run. How should I compile and run it on Linux?

···

--
*Chamila Dilshan Wijayarathna,*
SMIEEE, SMIESL,
Undergraduate,
Department of Computer Science and Engineering,
University of Moratuwa.

Ruby is often installed on linux, or can be easily installed with the
package manager. Personally, I prefer to build and install from the
source, like this:

# tar xzf /opt/src/ruby-2.0.0-p195.tar.gz
# cd ruby-2.0.0-p195
# ./configure
# make
# sudo make install
# irb
irb(main):001:0> RUBY_VERSION
=> "2.0.0"
irb(main):002:0> exit

···

#

--
Posted via http://www.ruby-forum.com/.

It helps if you explain how you tried to build it and why it didn't work
(what was the error?)

-Josh

···

On Tue, Jun 11, 2013 at 4:46 AM, Chamila Wijayarathna < cdwijayarathna@gmail.com> wrote:

I'm new to Ruby Development. I downloaded source from Github, but couldn't
build it. Can somebody tell me where I can download a ruby-lang source that
can be compiled and run. How should I compile and run it on Linux?

Hello,

I'm new to Ruby Development. I downloaded source from Github, but couldn't build it. Can somebody tell me where I can download a ruby-lang source that can be compiled and run. How should I compile and run it on Linux?

I'd like to use RVM ( http://rvm.io ) but if you tell us which version of linux are you running and what exactly do you want to do, we might be of better assistance :slight_smile:

--
Chamila Dilshan Wijayarathna,
SMIEEE, SMIESL,
Undergraduate,
Department of Computer Science and Engineering,
University of Moratuwa.

Panagiotis (atmosx) Atmatzidis

email: atma@convalesco.org
URL: http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

···

On 11 Ιουν 2013, at 11:46 , Chamila Wijayarathna <cdwijayarathna@gmail.com> wrote:
--
The wise man said: "Never argue with an idiot. They bring you down to their level and beat you with experience."

This is what I'm getting when running ruby and irb, same statements get
different results.

Attachments:
http://www.ruby-forum.com/attachment/8499/Screenshot_at_2013-06-12_22_35_28.jpg

···

--
Posted via http://www.ruby-forum.com/.

Per-erik Martin wrote in post #1112021:

Ruby is often installed on linux, or can be easily installed with the
package manager. Personally, I prefer to build and install from the
source, like this:

# tar xzf /opt/src/ruby-2.0.0-p195.tar.gz
# cd ruby-2.0.0-p195
# ./configure

I'm okay up to this point. But When I tried to run make, I'm getting
error saying "Executable host Ruby is required".

···

# make
# sudo make install
# irb
irb(main):001:0> RUBY_VERSION
=> "2.0.0"
irb(main):002:0> exit
#

--
Posted via http://www.ruby-forum.com/\.

I'm using Ubuntu 11.10.

Panagiotis Atmatzidis wrote in post #1112049:

···

I'd like to use RVM ( http://rvm.io ) but if you tell us which version
of linux are you running and what exactly do you want to do, we might be
of better assistance :slight_smile:

Panagiotis (atmosx) Atmatzidis

email: atma@convalesco.org
URL: http://www.convalesco.org
GnuPG ID: 0x1A7BFEC5
gpg --keyserver pgp.mit.edu --recv-keys 1A7BFEC5

--
Posted via http://www.ruby-forum.com/\.

Quoting Chamila W. (lists@ruby-forum.com):

Per-erik Martin wrote in post #1112021:
> Ruby is often installed on linux, or can be easily installed with the
> package manager. Personally, I prefer to build and install from the
> source, like this:
>
> # tar xzf /opt/src/ruby-2.0.0-p195.tar.gz
> # cd ruby-2.0.0-p195
> # ./configure

I'm okay up to this point. But When I tried to run make, I'm getting
error saying "Executable host Ruby is required".

Compilation of Ruby in the normal way requires a pre-existing ruby
interpreter. Maybe there is a way to compile from scratch - I do not
know. What I generally do on new machines (I use Debian) is first load
Debian's package with

apt-get install ruby

After compiling/installing (under /usr/local as default), you can do

apt-get purge ruby

and happily use your self-compiled interpreter plus utilities.

Remember to install the dev package of libreadline if you want to have
irb command history. Do that before running ./configure.

Carlo

···

Subject: Re: Getting Started With Development
  Date: mer 12 giu 13 03:44:55 +0900

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Chamila W. wrote in post #1112078:

Per-erik Martin wrote in post #1112021:

Ruby is often installed on linux, or can be easily installed with the
package manager. Personally, I prefer to build and install from the
source, like this:

# tar xzf /opt/src/ruby-2.0.0-p195.tar.gz
# cd ruby-2.0.0-p195
# ./configure

I'm okay up to this point. But When I tried to run make, I'm getting
error saying "Executable host Ruby is required".

Make sure that you are using the right source tar ball. The ones you
find here:
http://www.ruby-lang.org/en/
should not require a preinstalled ruby for boot strapping.

···

--
Posted via http://www.ruby-forum.com/\.

Thank you for helping.
I'm hoping to do changes to source and test them. Can I do this after
installing as you mentioned. How can I build after doing some change to
the code?

Carlo E. Prelz wrote in post #1112089:

···

Subject: Re: Getting Started With Development
  Date: mer 12 giu 13 03:44:55 +0900

Quoting Chamila W. (lists@ruby-forum.com):

error saying "Executable host Ruby is required".

Compilation of Ruby in the normal way requires a pre-existing ruby
interpreter. Maybe there is a way to compile from scratch - I do not
know. What I generally do on new machines (I use Debian) is first load
Debian's package with

apt-get install ruby

After compiling/installing (under /usr/local as default), you can do

apt-get purge ruby

and happily use your self-compiled interpreter plus utilities.

Remember to install the dev package of libreadline if you want to have
irb command history. Do that before running ./configure.

Carlo

--
Posted via http://www.ruby-forum.com/\.

I tried this also, it gives the same error "Executable host Ruby is
required".

···

Make sure that you are using the right source tar ball. The ones you
find here:
Ruby Programming Language
should not require a preinstalled ruby for boot strapping.

--
Posted via http://www.ruby-forum.com/\.

Carlo E. Prelz wrote in post #1112089:

Subject: Re: Getting Started With Development
  Date: mer 12 giu 13 03:44:55 +0900

Quoting Chamila W. (lists@ruby-forum.com):

error saying "Executable host Ruby is required".

Compilation of Ruby in the normal way requires a pre-existing ruby
interpreter. Maybe there is a way to compile from scratch - I do not
know. What I generally do on new machines (I use Debian) is first load
Debian's package with

apt-get install ruby installs Ruby 1.8.7, but I need to compile Ruby
2.0.0- ,Is it okay to use Ruby 1.8.7 as executable host?

···

apt-get install ruby

After compiling/installing (under /usr/local as default), you can do

apt-get purge ruby

and happily use your self-compiled interpreter plus utilities.

Remember to install the dev package of libreadline if you want to have
irb command history. Do that before running ./configure.

Carlo

--
Posted via http://www.ruby-forum.com/\.

Carlo E. Prelz wrote in post #1112089:

Subject: Re: Getting Started With Development
  Date: mer 12 giu 13 03:44:55 +0900

Quoting Chamila W. (lists@ruby-forum.com):

error saying "Executable host Ruby is required".

Compilation of Ruby in the normal way requires a pre-existing ruby
interpreter. Maybe there is a way to compile from scratch - I do not
know. What I generally do on new machines (I use Debian) is first load
Debian's package with

This works for me in Ubuntu? It works fine. Do I have to follow same
steps in MAC?

···

apt-get install ruby

After compiling/installing (under /usr/local as default), you can do

apt-get purge ruby

and happily use your self-compiled interpreter plus utilities.

Remember to install the dev package of libreadline if you want to have
irb command history. Do that before running ./configure.

Carlo

--
Posted via http://www.ruby-forum.com/\.

Quoting Chamila W. (lists@ruby-forum.com):

Thank you for helping.
I'm hoping to do changes to source and test them. Can I do this after
installing as you mentioned. How can I build after doing some change to
the code?

Once you have a running ruby, compilation works OK. Just do a
make. Keep in mind that the first executable found is generally the
one under /usr/local/bin. Check your PATH. After you have done make
install, the last interpreter you compiled will be used for further
compilations.

If you want to see the commands that are executed during make, you can
type

make V=1

Good luck with your changes... :wink:

Carlo

···

Subject: Re: Getting Started With Development
  Date: mer 12 giu 13 04:53:29 +0900

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Quoting Chamila W. (lists@ruby-forum.com):

apt-get install ruby installs Ruby 1.8.7, but I need to compile Ruby
2.0.0- ,Is it okay to use Ruby 1.8.7 as executable host?

Yes. For what needs to be done while compiling, 1.8 is enough.

Carlo

···

Subject: Re: Getting Started With Development
  Date: mer 12 giu 13 10:23:40 +0900

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Quoting Chamila W. (lists@ruby-forum.com):

This works for me in Ubuntu? It works fine. Do I have to follow same
steps in MAC?

I have no idea - I have no macintosh.

Carlo

···

Subject: Re: Getting Started With Development
  Date: Sun 23 Jun 13 12:13:20AM +0900

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)

Carlo E. Prelz wrote in post #1112089:

Subject: Re: Getting Started With Development
Date: mer 12 giu 13 03:44:55 +0900

Quoting Chamila W. (lists@ruby-forum.com):

error saying "Executable host Ruby is required".

Compilation of Ruby in the normal way requires a pre-existing ruby
interpreter. Maybe there is a way to compile from scratch - I do not
know. What I generally do on new machines (I use Debian) is first load
Debian's package with

This works for me in Ubuntu? It works fine. Do I have to follow same
steps in MAC?

On a Mac there is a ruby installed by default, and then you can use something like rvm https://rvm.io or chruby GitHub - postmodern/chruby: Changes the current Ruby (with ruby-install or ruby-build) to install and manage your own versions of ruby.

apt-get install ruby

After compiling/installing (under /usr/local as default), you can do

apt-get purge ruby

and happily use your self-compiled interpreter plus utilities.

Remember to install the dev package of libreadline if you want to have
irb command history. Do that before running ./configure.

Carlo

--
Posted via http://www.ruby-forum.com/\.

Hope this helps,

Mike

···

On 2013-06-22, at 11:13 AM, "Chamila W." <lists@ruby-forum.com> wrote:

--

Mike Stok <mike@stok.ca>
http://www.stok.ca/~mike/

The "`Stok' disclaimers" apply.

Carlo E. Prelz wrote in post #1112183:

Subject: Re: Getting Started With Development
  Date: mer 12 giu 13 10:23:40 +0900

Quoting Chamila W. (lists@ruby-forum.com):

apt-get install ruby installs Ruby 1.8.7, but I need to compile Ruby
2.0.0- ,Is it okay to use Ruby 1.8.7 as executable host?

But it gives errors for new features in Ruby 2.0 that was not in early
versions like "p %i{hurray huzzah whoop}".

···

Yes. For what needs to be done while compiling, 1.8 is enough.

Carlo

--
Posted via http://www.ruby-forum.com/\.

Mike Stok wrote in post #1113274:

How can I compile and run downloaded source code using these tools?

···

On 2013-06-22, at 11:13 AM, "Chamila W." <lists@ruby-forum.com> wrote:

On a Mac there is a ruby installed by default, and then you can use
something like rvm https://rvm.io or chruby
GitHub - postmodern/chruby: Changes the current Ruby (with ruby-install or ruby-build)
to install and manage your own versions of ruby.

Hope this helps,

Mike

--

Mike Stok <mike@stok.ca>
Mike Stok

The "`Stok' disclaimers" apply.

--
Posted via http://www.ruby-forum.com/\.

Quoting Chamila W. (lists@ruby-forum.com):

But it gives errors for new features in Ruby 2.0 that was not in early
versions like "p %i{hurray huzzah whoop}".

Do not worry. The interpreter is not asked to do anything like "p
%i{hurray huzzah whoop}" while compiling a new interpreter. As soon as
the new interpreter is ready, it will be used instead of the old one
for subsequent tasks.

Carlo

···

Subject: Re: Getting Started With Development
  Date: mer 12 giu 13 11:03:35 +0900

--
  * Se la Strada e la sua Virtu' non fossero state messe da parte,
* K * Carlo E. Prelz - fluido@fluido.as che bisogno ci sarebbe
  * di parlare tanto di amore e di rettitudine? (Chuang-Tzu)