# Problems after updating to rails 2.1

**URL:** <https://www.ruby-forum.com/t/problems-after-updating-to-rails-2-1/146037>\
**Category:** Rails\
**Created:** [August 16, 2008, 3:52pm UTC](https://www.ruby-forum.com/t/problems-after-updating-to-rails-2-1/146037 "2008-08-16T15:52:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [August 16, 2008, 3:52pm UTC](https://www.ruby-forum.com/t/problems-after-updating-to-rails-2-1/146037/1 "2008-08-16T15:52:16Z")

</div>

Hi everybody,

I just updated to rails 2.1 as root user, and noticed that non root  
users have different rails versions than root. I thought updating as  
root would make 2.1 available for all users. I was hoping this because  
some permissions problems prevent my normal user from updating rails to  
2.1. Look at the following gem lists. (I’m on a mac)

sline:~/eclipseWorkspace: gem list rails

\*\*\* LOCAL GEMS \*\*\*

rails (2.0.2, 1.2.3, 1.1.6)  
sline:~/eclipseWorkspace: su -  
Password:  
SlineMac:~ root# gem list rails

\*\*\* LOCAL GEMS \*\*\*

rails (2.1.0, 1.2.6, 1.2.3)  
SlineMac:~ root#

First, why are they different?

Second, If I try to upgrade to 2.1 as the non root user I get a  
permissions problem:

sline:~/eclipseWorkspace: gem install -v=2.1.0 rails  
— snip gem updating messages —  
ERROR: While executing gem … (Errno::EACCES)  
Permission denied -  
/usr/local/lib/ruby/gems/1.8/cache/activesupport-2.1.0.gem

Third if I try to create a new app now as non root user, I get a gem  
require error:

sline:~/eclipseWorkspace: rails fmpden  
/usr/local/bin/rails:17: undefined method `require\_gem’ for main:Object  
(NoMethodError)

I can create a new application as root, but jeepers, I don’t want to do  
my work as root, and while changing the perms on the new app so the non  
root user could use it would work, it is really a symptom of something  
being wrong.

Thank you for any help,  
Steve

---

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [August 16, 2008, 4:02pm UTC](https://www.ruby-forum.com/t/problems-after-updating-to-rails-2-1/146037/2 "2008-08-16T16:02:08Z")

</div>

Looks like ruby is installed “locally” for the “user”…

# which ruby

and

# ruby -v

for both root and the user. or maybe the environment is different  
somehow?

# env

for both users

---

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [August 16, 2008, 4:15pm UTC](https://www.ruby-forum.com/t/problems-after-updating-to-rails-2-1/146037/3 "2008-08-16T16:15:04Z")

</div>

heimdull wrote:

> Looks like ruby is installed “locally” for the “user”…
> 
> # which ruby
> 
> and
> 
> # ruby -v
> 
> for both root and the user. or maybe the environment is different  
> somehow?
> 
> # env
> 
> for both users

Wow, you’re right, here’s the output. Seems like my paths are not in  
the same order with respect to /usr/local/bin and /usr/bin. I can fix  
that. I wonder if that will fix everything else . . . We’ll see.

sline:~/eclipseWorkspace: which ruby  
/usr/local/bin/ruby

sline:~/eclipseWorkspace: ruby -v  
ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-darwin8.11.1]

sline:~/eclipseWorkspace: su -  
Password:  
SlineMac:~ root# which ruby  
/usr/bin/ruby

SlineMac:~ root# ruby -v  
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]

SlineMac:~ root# ls -ld /usr/bin/ruby  
lrwxr-xr-x 1 root wheel 76 Jul 22 08:26 /usr/bin/ruby -\>  
…/…/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby

SlineMac:~ root# ls -ld /usr/local/bin/ruby  
-rwxr-xr-x 1 root wheel 1824244 Apr 26 09:53 /usr/local/bin/ruby

---

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [August 16, 2008, 4:36pm UTC](https://www.ruby-forum.com/t/problems-after-updating-to-rails-2-1/146037/4 "2008-08-16T16:36:50Z")

</div>

I know this is weird, but after upgrading to leopard (or some other  
undetermined event), it appears the su - command doesn’t execute the  
root .bash\_profile anymore. So my .bash\_profile wasn’t getting executed  
and my paths are in different orders due to a default path being used  
for root.

---

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [August 16, 2008, 5:05pm UTC](https://www.ruby-forum.com/t/problems-after-updating-to-rails-2-1/146037/5 "2008-08-16T17:05:45Z")

</div>

Finally found the _root_ of the problem: my root login shell was changed  
to sh from bash. It used to be bash. I bet upgrading to leopard did  
this little favor for me. How sweet!

---

<div class="post-metadata">

**Author:** ![steveluscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3bc359/32.png) [@steveluscher](https://www.ruby-forum.com/u/steveluscher)\
**Post date:** [August 16, 2008, 4:45pm UTC](https://www.ruby-forum.com/t/problems-after-updating-to-rails-2-1/146037/6 "2008-08-16T16:45:43Z")

</div>

Steven L. wrote:

> I know this is weird, but after upgrading to leopard (or some other  
> undetermined event), it appears the su - command doesn’t execute the  
> root .bash\_profile anymore. So my .bash\_profile wasn’t getting executed  
> and my paths are in different orders due to a default path being used  
> for root.

So it’s probably fixed now. I su’d to root, manually ran my  
.bash\_profile so root is now using the same path and same ruby as non  
root users, and I gem updated rails. Now the non root users use the  
same 2.1 rails as root.

Thank you heimdull for your keen eye and superior intelligence!

Steve
