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.
7641cc060587bde6599ca811a1a52788?d=identicon&s=25 Sunder Iyer (Guest)
on 2006-04-11 21: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/ ???
0a5d6fa912dda67f9b81017fbd9a81f2?d=identicon&s=25 Shane Sherman (Guest)
on 2006-04-11 21: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.
48ae1944e6a82dffa18694663e72c931?d=identicon&s=25 Pedro Visintin (peterpunk)
on 2006-04-11 21:38
Shane Sherman 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
3ccecc71b9fb0a3d7f00a0bef6f0a63a?d=identicon&s=25 Kent Sibilev (Guest)
on 2006-04-11 21: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 Iyer <sunderlist@gmail.com> wrote:
> `prepare_application'
> /usr/local/lib/ruby/gems/1.8/gems/ ???
>
>
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>


--
Kent
---
http://www.datanoise.com
7641cc060587bde6599ca811a1a52788?d=identicon&s=25 Sunder Iyer (Guest)
on 2006-04-11 21: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.
7641cc060587bde6599ca811a1a52788?d=identicon&s=25 Sunder Iyer (Guest)
on 2006-04-11 22: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?
48ae1944e6a82dffa18694663e72c931?d=identicon&s=25 Pedro Visintin (peterpunk)
on 2006-04-11 22:15
Sunder Iyer 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
48ae1944e6a82dffa18694663e72c931?d=identicon&s=25 Pedro Visintin (peterpunk)
on 2006-04-11 22: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
A0ed1bbfe42f4f87e6db0a16706246e2?d=identicon&s=25 Guest (Guest)
on 2006-04-11 22: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.
7641cc060587bde6599ca811a1a52788?d=identicon&s=25 Sunder Iyer (Guest)
on 2006-04-11 23: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
0a5d6fa912dda67f9b81017fbd9a81f2?d=identicon&s=25 Shane Sherman (Guest)
on 2006-04-12 16: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.
48ae1944e6a82dffa18694663e72c931?d=identicon&s=25 Pedro Visintin (peterpunk)
on 2006-04-12 16:27
Shane Sherman 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
7641cc060587bde6599ca811a1a52788?d=identicon&s=25 Sunder Iyer (Guest)
on 2006-04-12 20:53
(Received via mailing list)
Yes, Iam hosting on textdrive.
48ae1944e6a82dffa18694663e72c931?d=identicon&s=25 Pedro Visintin (peterpunk)
on 2006-04-12 21:02
Sunder Iyer 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
0a5d6fa912dda67f9b81017fbd9a81f2?d=identicon&s=25 Shane Sherman (Guest)
on 2006-04-13 07: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?
48ae1944e6a82dffa18694663e72c931?d=identicon&s=25 Pedro Visintin (peterpunk)
on 2006-04-13 07:34
Shane Sherman 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
0a5d6fa912dda67f9b81017fbd9a81f2?d=identicon&s=25 Shane Sherman (Guest)
on 2006-04-20 05: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
12d7355717970c4293fb2c943a5ed804?d=identicon&s=25 Pedro Visintin (Guest)
on 2006-04-20 17:36
Shane Sherman 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
48ae1944e6a82dffa18694663e72c931?d=identicon&s=25 Pedro Visintin (peterpunk)
on 2006-05-07 22:35
Pedro Visintin wrote:
> Shane Sherman 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.