# Problem installing rails with gems

**URL:** <https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087>\
**Category:** Rails\
**Created:** [August 10, 2006, 4:02pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087 "2006-08-10T16:02:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [August 10, 2006, 4:02pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/1 "2006-08-10T16:02:12Z")

</div>

I have ruby 1.8.4 and gem 0.8.11 installed on Ubuntu Dapper.  
Now I wanted to use gem to install rails (as documented in the wiki).  
That worked fine, but afterwards, the command rails is not found.  
It seems that the gem install command does not place the binaries in the  
apropriate directory.

The instruction pages at the Rails websites show that one cun simply  
type “rails” after the gem install, but that does not work here.

Is that known/on purpose/a bug?

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [August 11, 2006, 11:14am UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/2 "2006-08-11T11:14:07Z")

</div>

Roman H. wrote:

> I have ruby 1.8.4 and gem 0.8.11 installed on Ubuntu Dapper.  
> Now I wanted to use gem to install rails (as documented in the wiki).  
> That worked fine, but afterwards, the command rails is not found.  
> It seems that the gem install command does not place the binaries in the  
> apropriate directory.
> 
> The instruction pages at the Rails websites show that one cun simply  
> type “rails” after the gem install, but that does not work here.
> 
> Is that known/on purpose/a bug?

Am I the only one who experiences this problem? Any ideas how I could  
find out what is going wrong here? It puzzles me that this is obviously  
supposed to install the binary somewhere where a standard Linux distro  
expects binaries, but this is obviously not happening in my case … ☹

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [August 15, 2006, 2:13pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/3 "2006-08-15T14:13:51Z")

</div>

Did you apt-get install ruby or compile it yourself?  
How did you install rubygems?

What is the output of  
which ruby  
which gem

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [August 15, 2006, 2:16pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/4 "2006-08-15T14:16:30Z")

</div>

I would not use the stock install of ruby on Ubuntu. I would compile  
from  
source. I will send you my instructions in another email. There are  
some  
specific steps I follow when doing so.

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [August 16, 2006, 4:54pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/5 "2006-08-16T16:54:31Z")

</div>

Aaron K. wrote:

> I would not use the stock install of ruby on Ubuntu. I would compile  
> from  
> source. I will send you my instructions in another email. There are  
> some  
> specific steps I follow when doing so.

Just out of curiosity - why? My guideline and indeed interest is to  
install as much as is reasonably possible from a package – not the  
least, because then I can uninstall it if required or update it  
if there is an update (even get notified by the update manager if  
the update is critical).

So … why would there be a problem with installing ruby with apt  
and why would this cause gem to misbihave in the way I described?

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [September 4, 2006, 2:45pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/6 "2006-09-04T14:45:21Z")

</div>

You may have done some of this already, so disregard the parts that  
already  
apply:

Me personally, I get the latest stable-snapshot, from [ruby-lang.org](http://ruby-lang.org). It  
is  
Ruby 1.8.5.

Extract the source somewhere.  
cd into that directory where you extracted the source.  
Edit ext/Setup  
uncomment zlib, ssl, readline

apt-get the following packages:

build-essential  
zlib1g-dev  
readline5-dev  
ncurses-dev

and when I install Ruby from source, I want it to go into /usr/bin  
rather  
than /usr/local/bin, so I set

./configure --prefix=/usr in the first stage

then make

then sudo make install

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [August 16, 2006, 4:52pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/7 "2006-08-16T16:52:30Z")

</div>

Jon L. wrote:

> Did you apt-get install ruby or compile it yourself?  
> How did you install rubygems?
> 
> What is the output of  
> which ruby  
> which gem

I installed ruby using apt-get install  
There is no gem package so I downloaded the distribution and  
installed it from there (as root).

which ruby  
 → /usr/bin/ruby  
ruby -v  
 → ruby 1.8.4 (2005-12-24) [i486-linux]  
which gem  
 → /usr/bin/gem  
gem environment  
 →

- VERSION: 0.8.11 (0.8.11)
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- GEM PATH:
  - /var/lib/gems/1.8

- REMOTE SOURCES:
  - [http://gems.rubyforge.org](http://gems.rubyforge.org)

As a workaround for now I put /var/lib/gems/1.8/bin in the PATH  
but that is not really how this should work, is it?

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [September 4, 2006, 2:45pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/8 "2006-09-04T14:45:22Z")

</div>

I run Dapper and I have installed ruby and rails on four different  
machines simply by doing:

sudo apt-get install ruby ri rdoc

Then I download the latest rubygems from RubyForge (0.9.0) untar it and  
run: sudo ruby setup.rb.

Then I do a sudo gem install rails --include-dependencies.

It works fine.

Jamey C.

Aaron K. wrote:

> ```
> It seems that the gem install command does not place the binaries
> _______________________________________________
> 
> ```
> 
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

Confidentiality Notice: This email message, including any attachments,  
is for the sole use of the intended recipient(s) and may contain  
confidential and/or privileged information. If you are not the intended  
recipient(s), you are hereby notified that any dissemination,  
unauthorized review, use, disclosure or distribution of this email and  
any materials contained in any attachments is prohibited. If you receive  
this message in error, or are not the intended recipient(s), please  
immediately notify the sender by email and destroy all copies of the  
original message, including attachments.

---

<div class="post-metadata">

**Author:** ![rhaus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e68b1a/32.png) [@rhaus](https://www.ruby-forum.com/u/rhaus)\
**Post date:** [September 4, 2006, 2:45pm UTC](https://www.ruby-forum.com/t/problem-installing-rails-with-gems/102087/9 "2006-09-04T14:45:39Z")

</div>

I forgot to mention that I then download the Rubygems zip file from  
[rubygems.rubyforge.org](http://rubygems.rubyforge.org) and run it manually, as well.

i.e. extract, then run sudo ruby setup.rb

Then I use gem to install rails and all the other fun stuff

Cheers,

Aaron K.
