Forum: Ruby on Rails Rails 1.1 in Production

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Sunder I. (Guest)
on 2006-04-11 23:14
(Received via mailing list)
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:in
`prepare_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:in
`process_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/ ???
Shane S. (Guest)
on 2006-04-11 23:24
(Received via mailing list)
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.
Pedro V. (Guest)
on 2006-04-11 23:38
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
Kent S. (Guest)
on 2006-04-11 23:39
(Received via mailing list)
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. <removed_email_address@domain.invalid> wrote:
> `prepare_application'
> /usr/local/lib/ruby/gems/1.8/gems/ ???
>
>
>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>


--
Kent
---
http://www.datanoise.com
Sunder I. (Guest)
on 2006-04-11 23:42
(Received via mailing list)
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. (Guest)
on 2006-04-12 00:07
(Received via mailing list)
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?
Pedro V. (Guest)
on 2006-04-12 00:15
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
Pedro V. (Guest)
on 2006-04-12 00:22
>> 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/sh...

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
Guest (Guest)
on 2006-04-12 00:34
> 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.
Sunder I. (Guest)
on 2006-04-12 01:46
(Received via mailing list)
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
Shane S. (Guest)
on 2006-04-12 18:13
(Received via mailing list)
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.
Pedro V. (Guest)
on 2006-04-12 18:27
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
Sunder I. (Guest)
on 2006-04-12 22:53
(Received via mailing list)
Yes, Iam hosting on textdrive.
Pedro V. (Guest)
on 2006-04-12 23:02
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. (Guest)
on 2006-04-13 09:24
(Received via mailing list)
This bug looks interesting and might be related
http://dev.rubyonrails.org/ticket/2346

anyone make any other progress on this yet?
Pedro V. (Guest)
on 2006-04-13 09:34
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
Shane S. (Guest)
on 2006-04-20 07:02
(Received via mailing list)
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
Pedro V. (Guest)
on 2006-04-20 19:36
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
Pedro V. (Guest)
on 2006-05-08 00:35
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
This topic is locked and can not be replied to.