Skip to content

Instantly share code, notes, and snippets.

View merbjedi's full-sized avatar

Jacques Crocker merbjedi

View GitHub Profile
[jc@macbookpro ~/Merb/whitelabel_classifieds]# thor merb:gem:install
Beginning transaction
Installing extlib-0.9.9
Installing abstract-1.0.0
Installing erubis-2.6.2
Installing rake-0.8.3
Installing json_pure-1.1.3
Installing rspec-1.1.11
Installing rack-0.4.0
Installing mime-types-1.15
[jc@macbookpro ~/Merb/whitelabel_classifieds]# thor merb:gem:install
Beginning transaction
Installing extlib-0.9.9
Installing abstract-1.0.0
Installing erubis-2.6.2
Installing rake-0.8.3
Installing json_pure-1.1.3
Installing rspec-1.1.11
Installing rack-0.4.0
Installing mime-types-1.15
[jc@macbookpro ~/Merb/whitelabel_classifieds]# thor merb:gem:install
Beginning transaction
Installing extlib-0.9.9
Installing abstract-1.0.0
Installing erubis-2.6.2
Installing rake-0.8.3
Installing json_pure-1.1.3
Installing rspec-1.1.11
Installing rack-0.4.0
Installing mime-types-1.15
[jc@macbookpro ~/Merb/whitelabel_classifieds]# thor merb:gem:install
Beginning transaction
Installing extlib-0.9.9
Installing abstract-1.0.0
Installing erubis-2.6.2
Installing rake-0.8.3
Installing json_pure-1.1.3
Installing rspec-1.1.11
Installing rack-0.4.0
Installing mime-types-1.15
@merbjedi
merbjedi / gist:36776
Created December 16, 2008 20:01
Merb 1.0.6 Dependency Handling
sudo gem update merb # install 1.0.6
cd ~/your/project
rm -Rf tasks/merb.thor
merb-gen thor # installs new merb dependency tasks
thor merb:gem:install # syncs all dependencies defined in config/dependencies.rb
[jc@macbookpro ~/Merb/whitelabel_classifieds]# thor merb:gem:install
Beginning transaction
Installing merb-core-1.0.6
- Successfully uninstalled merb-core-1.0.5
Installing merb-action-args-1.0.6
- Successfully uninstalled merb-action-args-1.0.5
Installing merb-assets-1.0.6
- Successfully uninstalled merb-assets-1.0.5
Installing merb-cache-1.0.6
- Successfully uninstalled merb-cache-1.0.5
Running a simple loop in Datamapper with a has n relationship (Post has n
pictures an integer property pictures_count).
Post.all.each do |p|
p.pictures_count = p.pictures.count
p.save
end
~ SELECT COUNT(*) FROM `pictures` WHERE (`post_id` IN (1))
~ SELECT `description_html`, `description_source`, `id` FROM `posts` WHERE
[jc@macbookpro ~]# gem --version
1.3.1
[jc@macbookpro ~]# ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9]
[jc@macbookpro ~]# sudo gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
# dependencies are generated using a strict version, don't forget to edit the dependency versions when upgrading.
merb_gems_version = "1.0.7.1"
dm_gems_version = "0.9.9"
# For more information about each component, please read http://wiki.merbivore.com/faqs/merb_components
dependency "merb-action-args", merb_gems_version
dependency "merb-assets", merb_gems_version
dependency "merb-cache", merb_gems_version
dependency "merb-helpers", merb_gems_version
dependency "merb-mailer", merb_gems_version
require "erb"
Gem.pre_install_hooks.push(proc do |installer|
$INSTALLING << installer.spec
unless File.file?(installer.bin_dir / "common.rb")
FileUtils.mkdir_p(installer.bin_dir)
FileUtils.cp(File.dirname(__FILE__) / "common.rb", installer.bin_dir / "common.rb")
end