Rails 1.1 in Production

My hosting company is still supporting only Rails 1.0. I have installed
Rails 1.1.2 to my vendor directory and deployed it in production which
should mean that my application should be using the Rails version in my
vendor diretory. But It looks like its still using local gem libraries,
here
is the error from dispatch.fcgi when I try and invoke my app

NoMethodError (undefined method const_load!' for Controllers:Module): /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:71:inprepare_application’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:37:in
dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:141:inprocess_request’
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/fcgi_handler.rb:53:in
`process!’

Why is it still looking for dispatcher.rb and fcgi_handler in the
/usr/local/lib/ruby/gems/1.8/gems/ ???

I am having the same problem. exported rails 1.1.2 to my vendor/rails
directory on textdrive, and my app fails to load with this exact same
error.
I have not found a solution yet.

Shane S. wrote:

I am having the same problem. exported rails 1.1.2 to my vendor/rails
directory on textdrive, and my app fails to load with this exact same
error.
I have not found a solution yet.

Same problem, I seems that load path is lookin up first on
/usr/local/lib/ruby/gems/1.8/gems/

I have this exports on my .bash_profile:

GEM_HOME=$HOME/gems…
GEM_PATH=$HOME/gems…:/usr/local/lib/ruby/gems/1.8

I think that we have a load problem, try to add an irregular inflection
on your environment.rb and will be ignored.

P

It seems that you didn’t upgrade properly. You should be using
rails-1.1.2 gem instead of rails-1.0.0 that this stack trace shows.

On 4/11/06, Sunder I. [email protected] wrote:

`prepare_application’
/usr/local/lib/ruby/gems/1.8/gems/ ???


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Kent

Not sure what you mean by ‘add an irregular inflection’. I read up on it
in
the wiki and it doesnt tell you how to switch ruby libraries. Do you
have an
example?

Well, which is why one would put Rails 1.1 in the vendor directory. I
cant
control what gems my host may or may not have installed. My issue is
that
the application seems to be reading off the rails gem installed on the
host
rather than my vendor directory.

Sunder I. wrote:

Not sure what you mean by ‘add an irregular inflection’. I read up on it
in
the wiki and it doesnt tell you how to switch ruby libraries. Do you
have an
example?

My model is in spanish so, english inflections sometimes differ.

I have to rewrite or specify inflections for pluralize.

On rails 1.0 I used to customize inflections through environment.rb but
in rails 1.1.* ignore them.

I preffer do not touch rails code. Adding new inflections rules to
environment.rb was fine, but does not work for now.

P

in
the wiki and it doesnt tell you how to switch ruby libraries. Do you
have an
example?

Im working on a shared host, and Im developing with edge and now with
1.1.2 but I dont want to request update every gem change so I searched
and found a way to install gems on home directory

Im started a Wiki for Argentine Rails comunity and you can find some
stuff (in spanish)
http://wiki.virtualizar.com.ar/onrailscomarwiki/show/Instalacion+de+Rails+y+Gems+en+un+hosting+compartido

step by step

mkdir -p ~/apps/lib/gems/1.8/cache
export GEM_HOME=$HOME/apps/lib/gems/1.8
export GEM_PATH=$HOME:/usr/lib/ruby/gems/1.8
cp /usr/lib/ruby/gems/1.8/cache/sources-0.0.1.gem
~/apps/lib/gems/1.8/cache
cd ~/apps/lib/gems/1.8/cache/
gem install sources --local
gem install my_gem

you can install any gem

does not work at all you can see the problem on the first post of this
thread

P

Why is it still looking for dispatcher.rb and fcgi_handler in the
/usr/local/lib/ruby/gems/1.8/gems/ ???

I think your config/boot.rb is out of date…

If you look in dispatch.fcgi you’ll see it requires ‘config/environment’
which requires ‘config/boot’ which is where the load_path munging
happens.

I even renamed the boot.rb in my config directory and added a symbolic
link
to the one present in /vendor/rails/railities/environments/boot.rb. Iam
still seeing the same exact error

fyi Here is my boot.rb

Don’t change this file. Configuration is done in config/environment.rb

and
config/environments/*.rb

unless defined?(RAILS_ROOT)
root_path = File.join(File.dirname(FILE), ‘…’)

unless RUBY_PLATFORM =~ /mswin32/
require ‘pathname’
root_path = Pathname.new(root_path).cleanpath(true).to_s
end

RAILS_ROOT = root_path
end

unless defined?(Rails::Initializer)
if File.directory?("#{RAILS_ROOT}/vendor/rails")
require “#{RAILS_ROOT}/vendor/rails/railties/lib/initializer”
else
require ‘rubygems’

environment_without_comments = IO.readlines(File.dirname(__FILE__) +

‘/environment.rb’).reject { |l| l =~ /^#/ }.join
environment_without_comments =~ /[^#]RAILS_GEM_VERSION = ‘([\d.]+)’/
rails_gem_version = $1

if version = defined?(RAILS_GEM_VERSION) ? RAILS_GEM_VERSION :

rails_gem_version
rails_gem = Gem.cache.search(‘rails’, “=#{version}”).first

  if rails_gem
    require_gem "rails", "=#{version}"
    require rails_gem.full_gem_path + '/lib/initializer'
  else
    STDERR.puts %(Cannot find gem for Rails =#{version}:
Install the missing gem with 'gem install -v=#{version} rails', or
change environment.rb to define RAILS_GEM_VERSION with your desired

version.
)
exit 1
end
else
require_gem “rails”
require ‘initializer’
end
end

Rails::Initializer.run(:set_load_path)
end

I’ve tried pretty much everything to solve this problem but I am at a
loss.
There is a textdrive thread on their forums with a bunch of people
having
the same issue. Sunder are you hosted on textdrive? Maybe it’s only a
problem there.

Shane S. wrote:

I’ve tried pretty much everything to solve this problem but I am at a
loss.
There is a textdrive thread on their forums with a bunch of people
having
the same issue. Sunder are you hosted on textdrive? Maybe it’s only a
problem there.

Im riding my own hosting.

Im still trying to find the solution.

P

Yes, Iam hosting on textdrive.

Sunder I. wrote:

Yes, Iam hosting on textdrive.

Sunder:

I have similar problem, I will try to solve this issue tonight (GMT-3)
and post the solution if founded.

P

Shane S. wrote:

This bug looks interesting and might be related
http://dev.rubyonrails.org/ticket/2346

anyone make any other progress on this yet?

I put on environment.rb
RAILS_GEM_VERSION = ‘1.1.2’

And rails get the current dependencies, but, mysql gem is out so I get
LOST CONNECTION TO MYSQL problem again.

this was solved with a sym link to main gem repository.

Hope helps

P

http://wiki.onrails.com.ar

I tried what you said and I still have the same problem. It does not fix
the
problem for me. Has anyone else run into this issue and have any
solutions?
My site has been down for 2 weeks now and I’ve tried just about
everything.
This issue also is being looked into from someone on the rails team :
http://dev.rubyonrails.org/ticket/4704

This bug looks interesting and might be related
http://dev.rubyonrails.org/ticket/2346

anyone make any other progress on this yet?

Pedro V. wrote:

Shane S. wrote:

I tried what you said and I still have the same problem. It does not fix
the
problem for me. Has anyone else run into this issue and have any
solutions?
My site has been down for 2 weeks now and I’ve tried just about
everything.
This issue also is being looked into from someone on the rails team :
http://dev.rubyonrails.org/ticket/4704

Have you tried to install rails 1.1.2 on custom gem dir?

I will try to reproduce your problem on next week, Im now on vacations.

Regards

P

http://wiki.onrails.com.ar

If you are using engines this is the workaround that I found

http://blogs.onrails.com.ar/articles/trackback/27

Pedro

Shane S. wrote:

I tried what you said and I still have the same problem. It does not fix
the
problem for me. Has anyone else run into this issue and have any
solutions?
My site has been down for 2 weeks now and I’ve tried just about
everything.
This issue also is being looked into from someone on the rails team :
http://dev.rubyonrails.org/ticket/4704

Have you tried to install rails 1.1.2 on custom gem dir?

I will try to reproduce your problem on next week, Im now on vacations.

Regards

P

http://wiki.onrails.com.ar