My environment
Vanilla Ubuntu 12.10, no rvm or renv.
> gem --version 1.8.23 > ruby --version ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] > bundle --version Bundler version 1.2.1
My problem
I have a rake task to pack my gems and upload them to my development and production servers. The problem is that the rake task does not work when the gemfile contains git or road graphs. Bundler already supports the packaging of these types of gemstones, and it works great on my terminal, but it fails when dealing with the rake job, and I can't figure out why.
My task is rake
> cat lib/tasks/upload.rake namespace :deploy do desc "Package all gems and upload to remote server" task :upload => [:environment] do |t, args| if ! system("bundle package --all") raise "TOTAL FAIL" end
My attempts
Running the package package in the terminal works:
> bundle package --all .... Using bson (1.7.0) Using bson_ext (1.7.0) Using cancan (1.6.8) from git://github.com/ryanb/cancan.git (at /home/ryujin/Projects/rails/Encluster4/vendor/cache/cancan-4dcd54459482) Using carrierwave (0.7.0) Using coffee-script-source (1.4.0) .... Updating files in vendor/cache Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. Updating files in vendor/cache
Running the package package with irb:
> irb irb> system("bundle package --all") ... Using ansi (1.4.3) Using bson (1.7.0) Using bson_ext (1.7.0) Using cancan (1.6.8) from git://github.com/ryanb/cancan.git (at /home/ryujin/Projects/rails/Encluster4/vendor/cache/cancan-4dcd54459482) Using carrierwave (0.7.0) Using coffee-script-source (1.4.0) ... Updating files in vendor/cache Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. Updating files in vendor/cache => true
But the package package does not work when performing my simple task:
> bundle exec rake deploy:upload Updating files in vendor/cache Could not find cancan-1.6.8.gem for installation rake aborted! TOTAL FAIL Tasks: TOP => deploy:upload (See full trace by running task with --trace)
I find no reason why this may fail. I constantly work in the same environment. I have already verified that the exec bundle file is the same (/ usr / local / bin / bundle) in all three cases. I have no traces of either rvm or renv or anything like that. Also tried to run the task without execle exec and the same problem.
Thanks in advance for any advice on why this is happening.
Horacio
source share