Misconfiguration on different machine


#1

I created and have a rails app running on one machine. It is using
rails 2.1. I ran:

rake rails:freeze
and
rake gems:unpack

on my rails app to put all dependencies into the vendor directory.
Then I checked it into my repository.

On a different machine, I checked out the repository and tried to run

rake db:schema:load --trace

but I got an error (see at the bottom of this post). I am trying to
use sqlite3 on both machines. The db directory is owned by the user
that I’m trying to run as, so it should be able to create the
production sqlite database that is set in the configs. As far as I
can tell, sqlite3 and the ruby interface to it are installed correctly
on the second machine.

By freezing rails and unpacking the gems into the vendor directory, it
is my understanding that I should be able to move the app between
machines without worrying about the proper gems being installed. Is
this correct?

Here is the error I get. Can anybody point me in the right direction
to get this solved?

Thanks,
Jonathan

$ rake db:schema:load --trace
(in /home/websites/insurance)
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method collect' for nil:NilClass /usr/lib/ruby/1.8/rubygems/version.rb:237:ininitialize’
/usr/lib/ruby/1.8/rubygems/version.rb:29:in new' /usr/lib/ruby/1.8/rubygems/version.rb:29:ininitialize’
/home/websites/insurance/config/…/vendor/rails/railties/lib/rails/
gem_dependency.rb:104:in new' /home/websites/insurance/config/../vendor/rails/railties/lib/rails/ gem_dependency.rb:104:inspecification’
/home/websites/insurance/vendor/rails/activesupport/lib/active_support/
core_ext/symbol.rb:11:in __send__' /home/websites/insurance/vendor/rails/activesupport/lib/active_support/ core_ext/symbol.rb:11:into_proc’
/home/websites/insurance/config/…/vendor/rails/railties/lib/rails/
plugin/locator.rb:81:in map' /home/websites/insurance/config/../vendor/rails/railties/lib/rails/ plugin/locator.rb:81:inplugins’
/home/websites/insurance/config/…/vendor/rails/railties/lib/rails/
plugin/loader.rb:63:in locate_plugins' /home/websites/insurance/config/../vendor/rails/railties/lib/rails/ plugin/loader.rb:62:inmap’
/home/websites/insurance/config/…/vendor/rails/railties/lib/rails/
plugin/loader.rb:62:in locate_plugins' /home/websites/insurance/config/../vendor/rails/railties/lib/rails/ plugin/loader.rb:27:inall_plugins’
/home/websites/insurance/config/…/vendor/rails/railties/lib/rails/
plugin/loader.rb:22:in plugins' /home/websites/insurance/config/../vendor/rails/railties/lib/rails/ plugin/loader.rb:45:inadd_plugin_load_paths’
/home/websites/insurance/config/…/vendor/rails/railties/lib/
initializer.rb:235:in add_plugin_load_paths' /home/websites/insurance/config/../vendor/rails/railties/lib/ initializer.rb:116:inprocess’
/home/websites/insurance/config/…/vendor/rails/railties/lib/
initializer.rb:93:in send' /home/websites/insurance/config/../vendor/rails/railties/lib/ initializer.rb:93:inrun’
/home/websites/insurance/config/environment.rb:13
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/home/websites/insurance/vendor/rails/activesupport/lib/active_support/
dependencies.rb:509:in require' /home/websites/insurance/vendor/rails/activesupport/lib/active_support/ dependencies.rb:354:innew_constants_in’
/home/websites/insurance/vendor/rails/activesupport/lib/active_support/
dependencies.rb:509:in require' /home/websites/insurance/vendor/rails/railties/lib/tasks/misc.rake:3 /usr/lib/ruby/1.8/rake.rb:546:incall’
/usr/lib/ruby/1.8/rake.rb:546:in execute' /usr/lib/ruby/1.8/rake.rb:541:ineach’
/usr/lib/ruby/1.8/rake.rb:541:in execute' /usr/lib/ruby/1.8/rake.rb:508:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/rake.rb:501:in synchronize' /usr/lib/ruby/1.8/rake.rb:501:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/rake.rb:518:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:1183:ineach’
/usr/lib/ruby/1.8/rake.rb:1183:in send' /usr/lib/ruby/1.8/rake.rb:1183:ineach’
/usr/lib/ruby/1.8/rake.rb:515:in invoke_prerequisites' /usr/lib/ruby/1.8/rake.rb:507:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/rake.rb:501:in synchronize' /usr/lib/ruby/1.8/rake.rb:501:ininvoke_with_call_chain’
/usr/lib/ruby/1.8/rake.rb:494:in invoke' /usr/lib/ruby/1.8/rake.rb:1931:ininvoke_task’
/usr/lib/ruby/1.8/rake.rb:1909:in top_level' /usr/lib/ruby/1.8/rake.rb:1909:ineach’
/usr/lib/ruby/1.8/rake.rb:1909:in top_level' /usr/lib/ruby/1.8/rake.rb:1948:instandard_exception_handling’
/usr/lib/ruby/1.8/rake.rb:1903:in top_level' /usr/lib/ruby/1.8/rake.rb:1881:inrun’
/usr/lib/ruby/1.8/rake.rb:1948:in standard_exception_handling' /usr/lib/ruby/1.8/rake.rb:1878:inrun’
/usr/bin/rake:28


#2

What gems are you freezing bsesides rails gems?

One common problem with this is that you freeze, say my_gem-0.3.4, but
the
other machine has my_gem-0.3.5 installed. Rails loads the system gem
because
it is newer than the frozen one.

So, try ‘gem list’ and compare frozen gem versions with the ones
installed.

On Tue, Oct 21, 2008 at 3:01 PM, JHuizingh removed_email_address@domain.invalid wrote:

/home/websites/insurance/config/…/vendor/rails/railties/lib/rails/
plugin/locator.rb:81:in plugins' /home/websites/insurance/config/../vendor/rails/railties/lib/rails/ /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in /usr/lib/ruby/1.8/rake.rb:546:inexecute’
/usr/lib/ruby/1.8/rake.rb:507:in invoke_with_call_chain' /usr/lib/ruby/1.8/rake.rb:1948:instandard_exception_handling’
/usr/lib/ruby/1.8/rake.rb:1878:in `run’
/usr/bin/rake:28


ANDRES RODRIGUEZ E
Electronic Engineer
Software Developer
IT Consultant

US Phone: (305) 853-8356
Primary Mobile: +57-300-2006186
Secondary Mobile: +57-314-7939859


#3

The original machine has
hpricot-0.6.161
mechanize-0.8.3
and 2.1.0 of all the rails related gems.

The new machine does not have hpricot or mechanize. It has rails
version 2.0.2-1 installed through the ubuntu package manager.

It’s my understanding that if you do the gem freezing step, it
shouldn’t matter what gems are installed on the machine. Is my
thinking right or wrong?


#4

I got the problem fixed.

The second machine I was trying to load the application on only had a
really old version of rails installed through my distro’s package
manager. I removed that, installed a new version of rails through
rubygems, and it worked. I guess I don’t understand the point of
freezing the rails gems if it doesn’t work in that situation, but I
have it working either way.

Thanks,
Jonathan


#5

That is only true for rails gems. Other gems may conflict.

Have you resolved the issue?

On Tue, Oct 21, 2008 at 10:19 PM, JHuizingh removed_email_address@domain.invalid wrote:

shouldn’t matter what gems are installed on the machine. Is my

it is newer than the frozen one.

this correct?
** Invoke environment (first_time)
/home/websites/insurance/vendor/rails/activesupport/lib/active_support/
plugin/loader.rb:62:in map' /home/websites/insurance/config/../vendor/rails/railties/lib/ dependencies.rb:509:inrequire’
/usr/lib/ruby/1.8/rake.rb:501:in synchronize' /usr/lib/ruby/1.8/rake.rb:1931:ininvoke_task’

ANDRES RODRIGUEZ E
Electronic Engineer
Software Developer
IT Consultant

US Phone: (305) 853-8356
Primary Mobile: +57-300-2006186
Secondary Mobile: +57-314-7939859


ANDRES RODRIGUEZ E
Electronic Engineer
Software Developer
IT Consultant

US Phone: (305) 853-8356
Primary Mobile: +57-300-2006186
Secondary Mobile: +57-314-7939859