Rails 2.2.3-1 Problem

After installing the rails I faced this problem. If anyone aware of this
problem, kindly give solution for this.

vellingiri@WebDevel:~/public_html/Isync$ ./script/server
=> Booting WEBrick...
/usr/local/lib/site_ruby/1.8/rubygems.rb:149:in `activate': can't
activate activeresource (= 2.3.4, runtime), already activated
activeresource-2.1.0 (Gem::Exception)
  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:35:in
`require'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in
`require'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in
`new_constants_in'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in
`require'
  from
./script/../config/../vendor/rails/railties/lib/initializer.rb:222:in
`require_frameworks'
  from
./script/../config/../vendor/rails/railties/lib/initializer.rb:222:in
`each'
  from
./script/../config/../vendor/rails/railties/lib/initializer.rb:222:in
`require_frameworks'
  from
./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in
`process'
  from
./script/../config/../vendor/rails/railties/lib/initializer.rb:93:in
`send'
  from
./script/../config/../vendor/rails/railties/lib/initializer.rb:93:in
`run'
  from /xhome/vellingiri/public_html/Isync/config/environment.rb:14
  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in
`require'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in
`new_constants_in'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in
`require'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/railties/lib/commands/servers/webrick.rb:59
  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in
`require'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:354:in
`new_constants_in'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/activesupport/lib/active_support/dependencies.rb:509:in
`require'
  from
/xhome/vellingiri/public_html/Isync/vendor/rails/railties/lib/commands/server.rb:39
  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
  from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
  from ./script/server:3

After installing the rails I faced this problem. If anyone aware of
this
problem, kindly give solution for this.

Usually means that something else in your app loaded a specific
version of activeresource prior to rails loading it.

Fred

Do you get the same error when running script/console ?

I would remove whatever gems I wasn't using.. looks like you have at
least a couple versions of Rails installed. If the extra versions
aren't there they can't be loaded to cause the error. Removing them
fixed similar issues for me a while back.

This error message makes it hard to believe that you just "created a
new application" - you've got a frozen version of Rails in vendor/
rails. Likely this is causing the problem. The 2.1-era gem loader had
some issues with gems that depended on Rails throwing errors when
Rails was vendored.

It's also possible that your Rubygems install is out of date - see the
documentation on gem update --system for more details.

--Matt Jones

Did you try removing gems you don't need? Do gem list to see what you
have got then gem uninstall to remove any old ones.
(http://rubygems.org/read/chapter/10#page38).

Colin

Colin Law wrote:

/usr/local/lib/site_ruby/1.8/rubygems.rb:149:in `activate': can't

--
Greg Donald
http://destiney.com/

When I use the script/console I got the same error,
ERROR:
[snip]

Did you try removing gems you don't need? Do gem list to see what you
have got then gem uninstall to remove any old ones.
(http://rubygems.org/read/chapter/10#page38).

Colin

Dear Friends,
     Now the old rails application is working fine. I have re-created
the rails application with existing one. For instance rails
/home/vellingiri/Isync. I did not overwrite the controller part, the
remaining part I created the new file.

It was working successfully. When I created the new application it was
throwing the error in apache "Object not found" . I have checked the
apache log file. File not found error is there.

ERROR:
   Pagination is not working properly in old rails application itself.
it returns the following error.

NoMethodError in PatchController#project_details

undefined method `paginate' for #<PatchController:0xb7b2ff18>

RAILS_ROOT: /xhome/vellingiri/public_html/vellingirinewpatch

If any one aware of this error, please give some idea about on this.

  Regards,
S.Vellingiri.

Dear Friends,
Now the old rails application is working fine. I have re-created
the rails application with existing one. For instance rails
/home/vellingiri/Isync. I did not overwrite the controller part, the
remaining part I created the new file.

For the record what was it that fixed the original problem?

It was working successfully. When I created the new application it was
throwing the error in apache "Object not found" . I have checked the
apache log file. File not found error is there.

ERROR:
Pagination is not working properly in old rails application itself.
it returns the following error.

NoMethodError in PatchController#project_details

undefined method `paginate' for #<PatchController:0xb7b2ff18>

RAILS_ROOT: /xhome/vellingiri/public_html/vellingirinewpatch

Have you remembered to install will_paginate?
Google for mislav-will_paginate if you don't know what this is.

Colin

Colin Law wrote:

Dear Friends,
Now the old rails application is working fine. I have re-created
the rails application with existing one. For instance rails
/home/vellingiri/Isync. I did not overwrite the controller part, the
remaining part I created the new file.

For the record what was it that fixed the original problem?

You did not answer this question. You should provide feedback here so
that others with similar problems who find this thread will know the
solution

undefined method `paginate' for #<PatchController:0xb7b2ff18>

RAILS_ROOT: /xhome/vellingiri/public_html/vellingirinewpatch

Have you remembered to install will_paginate?
Google for mislav-will_paginate if you don't know what this is.

Colin

I have installed both gem packages ( will_paginate, mislav-will_paginate
). It was installed successfully. Also I have required the module in
environment.rb file. Still the same problem is persists. Even if I take
out the require from the environment file, the same error is coming. Any
ideas?

MESSAGE:
vellingiri@WebDevel:~/public_html/vellingirinewpatch$ gem
install will_paginate
Successfully installed will_paginate-2.2.2
1 gem installed
Installing ri documentation for will_paginate-2.2.2...
Installing RDoc documentation for will_paginate-2.2.2...
vellingiri@WebDevel:~/public_html/vellingirinewpatch$ gem install
mislav-will_paginate
ERROR: could not find gem mislav-will_paginate locally or in a
repository

You say you installed both but the this says it did not install
mislav, but it installed will_paginate so it should be ok.
What does 'gem list' show?

vellingiri@WebDevel:~/public_html/vellingirinewpatch$ vim /et
etc/ etc.tar.gz
vellingiri@WebDevel:~/public_html/vellingirinewpatch$ vim config/envi
environment.rb environments/
vellingiri@WebDevel:~/public_html/vellingirinewpatch$ vim
config/environment.rb
require 'will_paginate'

Can you post environment.rb, it is not clear from above what you have there.
Also post the section of the controller that generate the undefined
method error.

Checked the log file:
NoMethodError (undefined method `paginate' for
#<PatchController:0xb77a30d4>):
/app/controllers/patch_controller.rb:172:in `patch_details'

You should not have had to check the log file, this should have
appeared in the browser. Are you running in development mode?

Colin

Colin Law wrote:

I dont know guys how you fixed this problem. I have one rails app that
runs as expected at port 80 using webrick. And another rails app running
at port 3001, that doesnt start. I get the same error as you:

ruby script/server -p 3001 -e production &
[2] 29028
root@li76-92:/home/magic/delivery/workspace/delivery-magic-wap#
/usr/local/lib/site_ruby/1.8/rubygems.rb:232:in `activate': undefined
method `map' for nil:NilClass (NoMethodError)
        from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:33:in `require'
        from
/home/magic/delivery/workspace/delivery-magic-wap/vendor/rails/railties/lib/commands/server.rb:1
        from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in
`gem_original_require'
        from
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
        from script/server:3

I uninstalled the multiple rails versions I had, and left the one that
works for the other app 2.2.3. This is my gem list output:

gem list

*** LOCAL GEMS ***

actionmailer (2.2.3)
actionpack (2.2.3)
activemerchant (1.10.0)
activerecord (2.2.3)
activeresource (2.2.3)
activesupport (3.0.5, 2.2.3)
authlogic (2.1.6)
braintree (2.8.0)
builder (3.0.0)
i18n (0.4.2)
jabber4r (0.8.0)
json (1.5.1)
linecache (0.43)
rack (1.1.2, 1.0.1)
railroad (0.5.0)
rails (2.2.3)
rake (0.8.7)
ruby-debug-base (0.10.4)
ruby-debug-ide (0.4.16)
rubygems-update (1.4.2)
xmpp4r (0.5)

Everything seems ok, but I still get this anoying error. I'm not using
apache, neither mongrel. Just trying to start with the default webrick..
The app works Ok at my development box, not at the VPS hosting.

Any clues and what could be wrong?

Please post your environment

OS, rubygems , webserver