Rails Upgrade / Installation Error

I have been learning Ror, and developing my first application. I
unfortunately am also relatively new to the mac, so please forgive my
ignorance if I did something blatantly ridiculous.

I have been using rails 2.2.2. I learned about
accepts_nested_attributes_for this morning, and realized I had to
update my version of rails.

I first performed a gem update. I cant recall the exact command I
invoked at this particular moment, but I believe it was rake
rails:update. There was an installation warning, and the installer
commented that it was installed in the following directory:

/Users/triguy_nc/.gem/ruby/1.8/bin

Being totally stupid, I figured - heck, this isnt goign to work, so I
inserted the above into my $PATH in .profile. I actually thought the
rake rails:update would have updated my version of rails (I was in a
working directory when I did this)

I then issued the following command: gem install -v=2.3.5 rails

I received the following error message after the install:

WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren’t both writable.
Successfully installed rails-2.3.5
1 gem installed
Installing ri documentation for rails-2.3.5…
Installing RDoc documentation for rails-2.3.5…
/users/triguy_nc/work/j4m1> ruby script/server
/Library/Ruby/Site/1.8/rubygems.rb:827:in report_activate_error': RubyGem version error: rack(1.0.0 not ~> 1.0.1) (Gem::LoadError) from /Library/Ruby/Site/1.8/rubygems.rb:261:inactivate’
from /Library/Ruby/Site/1.8/rubygems.rb:68:in gem' from /Users/triguy_nc/.gem/ruby/1.8/gems/actionpack-2.3.5/lib/ action_controller.rb:34 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
require' from /Users/triguy_nc/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:156:inrequire’
from /Users/triguy_nc/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:521:in new_constants_in' from /Users/triguy_nc/.gem/ruby/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:156:inrequire’
from /Users/triguy_nc/.gem/ruby/1.8/gems/rails-2.3.5/lib/commands/
server.rb:2
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:inrequire’
from script/server:3

When I issue $PATH at teh command prompt, I receive the following
response:

-bash: /Users/triguy_nc/.gem/ruby/1.8/bin:/opt/local/bin:/opt/local/
sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/
usr/X11/bin: No such file or directory

So, I am basically hosed, but do think I can revert to 2.2.2 in my
environment.rb. BUT, I really need to learn some basics of what I am
trying to do.

Questions:

  1. Can someone give me some guidance to undo my errors above, and
    repair my system so the installation is proper?
  2. Can you also point me to a tutorial to help me to understand the
    method to update rails, so I dont make the same hack mistakes again.

Thanks

Lee

Lee Brown wrote:

/Users/triguy_nc/.gem/ruby/1.8/bin

Being totally stupid,

snigger Nah. Just ignorant, like all of us when we first start!

I figured - heck, this isnt goign to work, so I
inserted the above into my $PATH in .profile. I actually thought the
rake rails:update would have updated my version of rails (I was in a
working directory when I did this)

That is the first thing you’ll need to undo - or rather, it’s fine, but
add it at the END of your path, not at the beginning.

I then issued the following command: gem install -v=2.3.5 rails

Well… Why don’t you try “gem update” now ? And then let’s see if
everything goes away.

I received the following error message after the install:

WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren’t both writable.

That’s because you should have done “sudo gem install” - although on a
one-user machine, this is merely semantics, on a multi-user machine, it
would mean that the gem is available for everyone. Likewise, “sudo gem
update” would do an update for all the gems in the machine’s repository.

Successfully installed rails-2.3.5
1 gem installed
Installing ri documentation for rails-2.3.5…
Installing RDoc documentation for rails-2.3.5…
/users/triguy_nc/work/j4m1> ruby script/server
/Library/Ruby/Site/1.8/rubygems.rb:827:in `report_activate_error’:
RubyGem version error: rack(1.0.0 not ~> 1.0.1) (Gem::LoadError)

Apparently, you need rack 1.0.1 … The “sudo gem update” command may
help.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs