Tag Archives: Rails

'report_activate_error': RubyGem version error

So from time to time I will post small things to my blog that I just want to keep track of or remember how I did something. This is one of those post. I should prefix this post to anyone who happens to come across it and read it, I am by no means a “Rails Developer” and as a matter of fact, I ran into this problem working through a “How to” books.

The issue

I am running OSX 10.6.2 and although I had Ruby on Rails working on it at one time, some how, some where it broke. Now there is nothing more frustrating to a n00b who is trying to work through a tutorial on how to learn a new programming language and not being able to get past the first chapter because something about the base install of the programming language that you don’t know anything about and you’re trying to learn, wont work.

The Actual Error

When I try to create my first controller this is what happens
[bash]
ruby script/generate controller main welcome
[/bash]
And this is what the system kicked out to me
[bash]
/Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:271:in `require_frameworks’: RubyGem version error: rack(1.0.0 not ~> 1.0.1) (RuntimeError)

from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:134:in `process’
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `send’
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in `run’
from /Users/eric/Dropbox/Code/Rails/r4music1/config/environment.rb:9
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:in `require’
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/generate.rb:1
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:in `require’
from script/generate:3
[/bash]
Sidebar
Naturally, the first thing I do is start hitting Google and start clicking on links. A lot of similar issues with a wide variety of solutions. From just doing a simple ‘sudo gem update’, to making sure rake is installed, to making sure you have the correct rake version installed. None of which worked for me. Finally, I stumbled onto Wojno’ Site and following the steps in his post I manage to resolve my problem.

The Fix
If you didn’t want to click on Wonjno’s link here are the steps that fixed my problem. Had to change a couple of things because my install paths were a little different since I was running a different OS.
We begin by uninstalling the problem package
[bash]
sudo gem uninstall rack
[/bash]
When prompted, make sure you remove all versions of the rack packages. Now this is one place where my experience differed a little. I ended up getting prompted to uninstall rails itself. I’m a brave soul, that didn’t scare me, so yeah I uninstalled it.
Here is what that looked like
[bash]
sudo gem uninstall rack
Remove executables: rackup in addition to the gem? [Yn]  Y
Removing rackup
You have requested to uninstall the gem: rack-1.0.0
actionpack-2.3.3 depends on [rack (~> 1.0.0)]
actionpack-2.3.5 depends on [rack (~> 1.0.0)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]  Y
[/bash]
OK, that was a little scary but we will fix it.
I did manually remove the directory for the older version of rack
[bash]
sudo rm -rf /Library/Ruby/Gems/1.8/gems/rack-1.0.1/
[/bash]
Now we reinstall things. Don’t forget we need to reinstall the rails itself
[bash]
sudo gem install -v=2.3.5 rails
sudo gem install rack
[/bash]
After that, life was good, at least for me. If you found this article and actually read it in hopes that it helped fix your issue, well then I hope you had some success as well.

Advertisements
Tagged , , ,
%d bloggers like this: