You are not logged in.

#1 2013-03-16 21:49:01

mrb101
Member
Registered: 2012-06-30
Posts: 26

Installing Rails.

So i just setup my archlinux box and while installing rails i gone through this problem.

[mrb@archbook ~]$ gem install rails --no-ri --no-rdoc
WARNING:  You don't have /home/mrb/.gem/ruby/1.9.1/bin in your PATH,
      gem executables will not run.
Successfully installed rails-3.2.12
1 gem installed

Now trying

[mrb@archbook ~]$ rails -v
bash: rails: command not found

same with sudo

[mrb@archbook ~]$ ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]

trying updating

[mrb@archbook ~]$ sudo gem update                           
Updating installed gems
Updating builder
Fetching: builder-3.2.0.gem (100%)
WARNING:  You don't have /root/.gem/ruby/1.9.1/bin in your PATH,
      gem executables will not run.
Successfully installed builder-3.2.0
[the rest of the list]

What should i do ?!

thanks

Offline

#2 2013-03-16 21:51:40

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: Installing Rails.

Seriously, did you read the "WARNING"?

Offline

#3 2013-03-25 12:22:46

Aegidius
Member
From: Italy
Registered: 2011-06-29
Posts: 288
Website

Re: Installing Rails.

I have the same problem and I get the same warning. How to solve that?

Offline

#4 2013-03-25 12:27:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Installing Rails.

Serious, did you read the warning ... or Scimmia's post.

The installation location is not in your $PATH.  Add it to your path, or specify the binary with the full path to it's location.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2013-03-25 12:30:59

Aegidius
Member
From: Italy
Registered: 2011-06-29
Posts: 288
Website

Re: Installing Rails.

How can I find the full path to Rails?

Offline

#6 2013-03-25 12:35:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Installing Rails.

I'd hate to use the exact same response for a third time - but it's in the warning message.  It's a one line message; read it.

Last edited by Trilby (2013-03-25 12:38:32)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2013-03-25 12:38:18

Aegidius
Member
From: Italy
Registered: 2011-06-29
Posts: 288
Website

Re: Installing Rails.

I'm sorry, but I have no .gem directory in my home.

Offline

#8 2013-03-25 12:42:26

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Installing Rails.

I bet you do.

Try "ls -a ~", when that works, go find a shell tutorial, Greg's wiki is good.  And don't be a help vampire (unfortunately the link to the relevant article for this is currently down).

EDIT: it's back up: http://slash7.com/2006/12/22/vampires/

Last edited by Trilby (2013-03-25 13:42:43)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2013-03-25 13:30:16

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: Installing Rails.

When you installed Ruby, you should have gotten a message about gems:

The default location of gem installs is $HOME/.gem/ruby
Add the following line to your PATH if you plan to install using gem
$(ruby -rubygems -e "puts Gem.user_dir")/bin
If you want to install to the system wide location, you must either:
edit /etc/gemrc or run gem with the --no-user-install flag.

Ideally, you should install gems as your regular user, and modify your PATH.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#10 2013-03-25 13:30:39

Aegidius
Member
From: Italy
Registered: 2011-06-29
Posts: 288
Website

Re: Installing Rails.

I don't understand why you are so rude.

I guess that I have to find the rails path and add an alias to my ~/.bashrc file, but I cannot find the rails path.

As shown above, I guess the full path is /home/mrb/.gem/ruby/1.9.1/bin, where mrb is replaced my username. Well, in my home I have no .gem directory. Now I'm asking what is the rails full path if it is not.

I thank you for the answers, despite the rudeness.

Offline

#11 2013-03-25 13:32:06

Aegidius
Member
From: Italy
Registered: 2011-06-29
Posts: 288
Website

Re: Installing Rails.

WorMzy I installed ruby gem as root. What can I do now?

Offline

#12 2013-03-25 13:34:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Installing Rails.

Then it's in /root/.gem, just like the warning message you recieved would have told you.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#13 2013-03-25 13:39:00

Aegidius
Member
From: Italy
Registered: 2011-06-29
Posts: 288
Website

Re: Installing Rails.

Finally I found it!

It is own by the root user. What do you suggest me? Keep it as it is and lunch it with sudo, change permission or reinstall it with no sudo permissions?

Offline

#14 2013-03-25 13:45:13

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,788
Website

Re: Installing Rails.

Aegidius wrote:

WorMzy I installed ruby gem as root. What can I do now?

You can either:

  1. Install it as your normal user (optionally removing it from root)

  2. Install it system-wide using a method outlined in the installer message

  3. Make /root/.gem/ruby/ruby_ver/bin readable as non-root users and give non-root users the ability to navigate to this directory (chmod o+x to parent directories)

I'd say option one is best if you're planning on using rails for development, and option three is best for production.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#15 2013-03-25 13:49:34

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: Installing Rails.

Aegidius, I am sorry if you feel I was rude.  That is not my intention.  However, the trajectory of your questions is not a productive one.

I added this link in an edit above: http://slash7.com/2006/12/22/vampires/

You may also be well served to read ESR's article on asking good questions that is commonly linked.

If I don't like your questions, though, you may wonder why I respond at all.  There are a few reasons: 1) I have hope that your questions can/will improve and be more useful in creating forum threads that will help others, 2) If your questions don't change, then at least I'd hope you can recognize how they effect the spirit of would-be-helpers.

I may be blunt, but I'm responding.  I suspect many users who quickly could have answered your questions, just looked the other way as it didn't seem worth their time.  I thought it might be worth mine - that remains to be seen.

When you present questions, present the relevant information.  Don't say you did the same thing as the OP, when you in fact did something different (installed with sudo).  Don't say you don't know how to modify your path when a simple google search would tell you exactly how.  Do say what you have tried, and what actual error messages you recieved.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#16 2013-03-25 14:02:54

Aegidius
Member
From: Italy
Registered: 2011-06-29
Posts: 288
Website

Re: Installing Rails.

So, the problem is about the form of my question, not about the content? In this case, I understand and I'm sorry for being inaccurate. I promise I will be more precise in asking questions next times.

Offline

Board footer

Powered by FluxBB