Developers: Vendored Gems

6 views
Skip to first unread message

Scott Willson

unread,
Jul 31, 2009, 1:23:33 PM7/31/09
to racing-...@googlegroups.com
Hi everyone,

I've updated the code to use Rails 2.3.3, which turned out to be a
bigger change that I expected.

I've also vendored/unpacked as many dependent gems as I could into /
vendor. This should make it easier to get started, and to keep our
production deployments in synch. It does make for a bigger download,
though.

It doesn't seem possible to vendor Rake or Rack, so those are still
prerequisites, as are Ruby, RubyGems, and the native MySQL gem.

Oh, I also replaced the crufty Selenium on Rails-based acceptance
tests with Selenium RC. We should see fewer false-positives. It does
mean that you need Java installed to run the acceptance tests now.
There's no escape, I guess!

Scott

ryanrockets

unread,
Aug 19, 2009, 2:58:09 AM8/19/09
to Racing on Rails
Thanks, Scott, for the update!

Was there ever a gem that enabled the use of the local directory, or
am I imagining things? It seems rake db:create is looking for MySQL
connection credentials in config/database.yml, but
racing_on_rails:bootstrap is looking at local/config/database.yml. I
thought maybe my setup was incomplete.

I looked all over the Trac Wiki (especially the sweet page on
Customization!) but a reference to this old memory is lacking.

RyanR>

Scott Willson

unread,
Aug 19, 2009, 2:57:19 PM8/19/09
to racing-...@googlegroups.com
You're welcome, Ryan.

On config/database.yml … it depends. If the Rails environment is
loaded, it should honor this code in config/environment.rb:
if File.exists?("#{RAILS_ROOT}/local/config/database.yml")
config.database_configuration_file = "#{RAILS_ROOT}/local/config/
database.yml"
end

But some Rake tasks just read config/database.yml.

If database.yml was a Ruby file instead of a YAML file, we could do
something similar to the Cap recipes:
load "local/config/deploy.rb" if File.exists?("local/config/deploy.rb")

There was some move afoot to replace database.yml with something like
database.rb, but I don't know if it ever made it into Rails.

I'm open to clever-er, seamless-er ideas on the DB config.

Scott

Al Pendergrass

unread,
Aug 20, 2009, 12:24:04 PM8/20/09
to racing-...@googlegroups.com
Scott,

I'm back from a long vacation. After pulling in your latest I get the following when starting the app. If I back out the commit the app runs fine. Is there something I need to do to use vendored gems?

- Al

-----------------------------

=> Booting Mongrel
=> Rails 2.3.3 application starting on http://0.0.0.0:3000
no such file to load -- color
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/Users/al/Sites/racing_on_rails/vendor/gems/pdf-writer-1.1.8/lib/pdf/writer.rb:15
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
./script/../config/../vendor/rails/railties/lib/rails/gem_dependency.rb:208:in `load'
./script/../config/../vendor/rails/railties/lib/initializer.rb:307:in `load_gems'
./script/../config/../vendor/rails/railties/lib/initializer.rb:307:in `each'
./script/../config/../vendor/rails/railties/lib/initializer.rb:307:in `load_gems'
./script/../config/../vendor/rails/railties/lib/initializer.rb:169:in `process'
./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
./script/../config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
/Users/al/Sites/racing_on_rails/config/environment.rb:5
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Users/al/Sites/racing_on_rails/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
script/server:87
Missing these required gems:
  pdf-writer 

You're running:
  ruby 1.8.6.287 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  rubygems 1.3.1 at /Users/al/.gem/ruby/1.8, /Library/Ruby/Gems/1.8, /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

Run `rake gems:install` to install the missing gems.

Al Pendergrass

unread,
Aug 20, 2009, 12:43:29 PM8/20/09
to racing-...@googlegroups.com
Scott,

Nevermind. I updated rake gem and all is well now it seems. Sorry for the trouble.

- Al

Scott Willson

unread,
Aug 20, 2009, 12:47:48 PM8/20/09
to racing-...@googlegroups.com
No problem! I appreciate you trying it out and letting me know where it failed. I admit I was scratching my head, though.

I like the concept of packaging all the dependencies together, and it seems to wok, but there are rough edges in the 2.x version of Rails. Things look to become saner in Rails 3, from what I can tell.

Scott
Reply all
Reply to author
Forward
0 new messages