Custom_require.rb

I’ve been tryng to duplicate an ancient Ruby 1.86 Rails 2.3.2 app on a
brand new Linux box (over from a windows box) and have, under rpm,
recreated all the gems with their corret versions.

However, when I go to invoke

ruby script/server

I am getting:

=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/rails-2.3.2/lib/rails/gem_dependency.rb:99:Warning:
Gem::Dependency#version_requirements is deprecated and will be removed
on
or after August 2010. Use #requirement
/home/user/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require': no such file to load -- ruby-debug (MissingSourceFile) from /home/user/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in
require' from /home/user/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:innew_constants_in’
from
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in
require' from /home/user/ggrip/ggripv2/config/environments/development.rb:2:inload_environment’
from
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/rails-2.3.2/lib/initializer.rb:365:in
load_environment' from /home/user/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:insilence_warnings’
from
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/rails-2.3.2/lib/initializer.rb:358:in
load_environment' ... 9 levels... from /home/user/.rvm/gems/ruby-1.8.6-p420/gems/rails-2.3.2/lib/commands/server.rb:84 from /home/user/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require’
from
/home/user/.rvm/rubies/ruby-1.8.6-p420/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require’
from script/server:3

I’m at a loss here as to what to change to get this thing to fire up –
Im
just not sure what it is telling me needs to be changed in my
custom_require.rb, below, in order to start. Can someone please orient
me
here what I need to do? Thanks, RVic

#–

Copyright 2006 by Chad F., Rich Kilmer, Jim W. and others.

All rights reserved.

See LICENSE.txt for permissions.

#++

require ‘rubygems’

module Kernel

The Kernel#require from before RubyGems was loaded.

alias gem_original_require require

When RubyGems is required, Kernel#require is replaced with our own

which

is capable of loading gems on demand.

When you call require ‘x’, this is what happens:

* If the file can be loaded from the existing Ruby loadpath, it

is.

* Otherwise, installed gems are searched for a file that matches.

If it’s found in gem ‘y’, that gem is activated (added to the

loadpath).

The normal require functionality of returning false if

that file has already been loaded is preserved.

def require(path) # :doc:
gem_original_require path
rescue LoadError => load_error
if load_error.message =~ /#{Regexp.escape path}\z/ and
spec = Gem.searcher.find(path) then
Gem.activate(spec.name, “= #{spec.version}”)
gem_original_require path
else
raise load_error
end
end

private :require
private :gem_original_require

end

On 28 October 2013 15:10, RVic [email protected] wrote:

=> Booting Mongrel
=> Rails 2.3.2 application starting on http://0.0.0.0:3000

/home/user/.rvm/gems/ruby-1.8.6-p420/gems/rails-2.3.2/lib/rails/gem_dependency.rb:99:Warning:

Gem::Dependency#version_requirements is deprecated and will be removed on or
after August 2010. Use #requirement

The warning is because you have a later version of rubygems than
rails. It is only a warning, you can ignore it.

/home/user/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in

just not sure what it is telling me needs to be changed in my
custom_require.rb, below, in order to start. Can someone please orient me
here what I need to do? Thanks, RVic

There is nothing wrong with custom_require.rb, the problem is that it
cannot find the ruby-debug gem. Unless you need to use it just remove
it from development.rb (I think that is where it is being required
from).

Colin

On 28 October 2013 15:10, RVic [email protected] wrote:

I’ve been tryng to duplicate an ancient Ruby 1.86 Rails 2.3.2 app on a brand
new Linux box (over from a windows box) and have, under rpm, recreated all
the gems with their corret versions.

Looking back I see you had exactly the same problem on 23rd Oct and I
replied exactly the same as I have done above. Did it not work the
first time? You then came back with a different problem about
executable-hooks. I assumed you had fixed the ruby-debug problem.

Colin

On 28 October 2013 15:48, RVic [email protected] wrote:

(Incidentally, under rvm, if I were to install 1.8.7, would I need to
reinstall all the gems I have installed under 1.8.6? Does rvm create another
new, empty ruby “slot” in that regard that moves with the version selected?)

Yes

from script/server:2

Line 39 of boot.rb is:

Rails::Initializer.run(:set_load_path)

Which version of rubygems are you running?
gem -v

Colin

gem -v
/home/user/.rvm/rubies/ruby-1.8.6-p420/bin/gem:21: uninitialized
constant
Gem::GemRunner (NameError)

I thought I had installed 2.3.2 ?

On 28 October 2013 16:32, RVic [email protected] wrote:

gem -v
/home/user/.rvm/rubies/ruby-1.8.6-p420/bin/gem:21: uninitialized constant
Gem::GemRunner (NameError)

I thought I had installed 2.3.2 ?

That is Rails, we are talking here about rubygems. You probably want
version 1.3.7. Did you run gem -v from your application root?

I don’t understand the error, but to install rubygems 1.3.7 try
rvm install rubygems 1.3.7

then see if gem -v works.

Colin

Colin,

I was able to fix executable-hooks (which installing 1.8.6 under rvm was
causing) per Michal Papas this morning. I;ve tried to instaull
ruby-debug-base, etc. but:

gem install --remote ruby-debug
ERROR: Error installing ruby-debug:
linecache requires Ruby version >= 1.8.7.

(Incidentally, under rvm, if I were to install 1.8.7, would I need to
reinstall all the gems I have installed under 1.8.6? Does rvm create
another new, empty ruby “slot” in that regard that moves with the
version
selected?)

You are right, ruby-deub existed in my develoment.rb, which I commented
out, restarted, and:

ruby script/server
./script/…/config/boot.rb:39:in run': uninitialized constant Rails::Initializer (NameError) from ./script/../config/boot.rb:11:inboot!’
from ./script/…/config/boot.rb:110
from script/server:2:in `require’
from script/server:2

Line 39 of boot.rb is:

Rails::Initializer.run(:set_load_path)

I’m really struggling with discerning what these error messages mean. It
takes a while to get into the Ruby idiom, even longer using an old app,
when you have been away from it for a few years (not by virtue of
wanting
to be away from it though) Rvic

Colin,

I installed
rvm install rubygems 1.3.7
right after installing rvm, right before I installed rails 2.3.2

I went and re-installed it, and now:

gem -v
1.3.7

On 28 October 2013 17:07, RVic [email protected] wrote:

Please don’t top post, and remember to quote the relevant bits of the
previous message. Thanks.

Colin,

I installed
rvm install rubygems 1.3.7
right after installing rvm, right before I installed rails 2.3.2

I went and re-installed it, and now:

gem -v
1.3.7

And…

Any difference to your problem? We are not telepathic.

Colin

On 28 October 2013 17:30, RVic [email protected] wrote:

Colin,

You underestimate yourselves – I think the guys in this group do exhibit
telepathic qualities (I say that because i am very grteful to all the hlpe I
have been offered here, and hoe to reciprocate in the not-too-distant
future).

(Im sorry, I am on the google grups page, and seemingly unable to get
anything of the thread in this message save for the first message in the
thread, which I am not dupicating)

In that case please subscribe to the list and access it through email.

Yes, it made a big difference! Now, however (because I am using the
authlogic gem I believe, and now on linux as opposed to a windows
installation previously that I am porting this over from):
ruby script/server

/home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:163:in

`ensure_session_key’: A key is required to write a cookie containing the
session data. Use config.action_controller.session = { :key =>
“_myapp_session”, :secret => “some secret phrase” } in config/environment.rb

Well that is clear enough I think.

Colin

Colin,

You underestimate yourselves – I think the guys in this group do
exhibit
telepathic qualities (I say that because i am very grteful to all the
hlpe
I have been offered here, and hoe to reciprocate in the not-too-distant
future).

(Im sorry, I am on the google grups page, and seemingly unable to get
anything of the thread in this message save for the first message in the
thread, which I am not dupicating)

Yes, it made a big difference! Now, however (because I am using the
authlogic gem I believe, and now on linux as opposed to a windows
installation previously that I am porting this over from):
ruby script/server
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:163:in
ensure_session_key': A key is required to write a cookie containing the session data. Use config.action_controller.session = { :key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb (ArgumentError) from /home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/session/cookie_store.rb:74:ininitialize’
from
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:72:in
new' from /home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:72:inbuild’
from
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:116:in
build' from /home/user/.rvm/gems/ruby-1.8.6-p420/gems/activesupport-2.3.2/lib/active_support/inflector.rb:361:ininject’
from
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:116:in
each' from /home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:116:ininject’
from
/home/user/.rvm/gems/ruby-1.8.6-p420/gems/actionpack-2.3.2/lib/action_controller/middleware_stack.rb:116:in
build' ... 8 levels... from ./script/../config/boot.rb:11:inboot!’
from ./script/…/config/boot.rb:110
from script/server:2:in `require’
from script/server:2

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