Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8952697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:55:53+00:00 2026-06-15T13:55:53+00:00

My Environment Vanilla Ubuntu 12.10, no rvm or renv. > gem –version 1.8.23 >

  • 0

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 package my gems and upload them to my development and production servers. The problem is that the rake task fails when the Gemfile includes git or path gems. Bundler already supports packaging of these type of gems and it works great on my terminal but it fails when running withing a rake task and I cannot find out why.

My rake task

> 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

    # Magic method to upload vendor/cache to remote server
  end
end

My tries

Running bundle 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 bundle package withing irb also works:

> 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 bundle package does not work when executed within my simple rake 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 not reason why this could fail. I am running in the same environment all the time. I already checked the bundle exec file is the same (/usr/local/bin/bundle) on all three cases. I have no traces or rvm or renv or anything like that. Also tried running the task without bundle exec and the same problem.

Thanks in advance for any tips on why this happens.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:55:54+00:00Added an answer on June 15, 2026 at 1:55 pm

    I had the same trouble.
    I checked the environment variables and find out that the bundler modifies RUBYOPT:

    $ bundle exec env > benv.txt
    $ env > env.txt
    $ diff -u env.txt benv.txt
    --- env.txt 2012-12-05 17:13:10.000000000 +0400
    +++ benv.txt  2012-12-05 17:13:07.000000000 +0400
    @@ -72,4 +72,8 @@
     CDPATH=.
     install_flag=1
     rvm_hook=
    -_=/usr/bin/env
    +_=/Users/denis/.rvm/gems/ruby-1.9.3-p327@global/bin/bundle
    +_ORIGINAL_GEM_PATH=/Users/denis/.rvm/gems/ruby-1.9.3-p327:/Users/denis/.rvm/gems/ruby-1.9.3-p327@global
    +BUNDLE_BIN_PATH=/Users/denis/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/bin/bundle
    +BUNDLE_GEMFILE=/Users/denis/src/my-project/Gemfile
    +RUBYOPT=-I/Users/denis/.rvm/gems/ruby-1.9.3-p327@global/gems/bundler-1.2.3/lib -rbundler/setup
    

    So, to workaround I do this:

    system %Q(/usr/bin/env RUBYOPT= bundle package)
    

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ENVIRONMENT ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10.8.0]; Rails 3.2.6; OSX 10.6.8; devise (2.0.4); forem-redcarpet
Environment: Rails 3.0.1 Ruby 1.8.7 MySQL 5.5.16 Community server...Jdk 1.6 gem 'sunspot_rails' gem 'sunspot_solr'
environment/cucumber.rb: ... # gem dependencies config.gem 'cucumber-rails', :lib => false, :version => '>=0.3.0' unless
Environment: Ruby 1.9.2, Rails 3.0.3, Ubuntu When I try to open a URL using:
Environment: Linux 2.6.32 (RHEL 6.3) on x86_64 with gcc 4.4.6 Background: I am running
I would like to download a script from a vanilla MSYS environment. On Linux,
Environment: hudson/sonar/maven2 in ubuntu locally with default parameters And I got the log from
Environment is REE(2011.12) on rvm, rspec 2.8.0, rails 3.0.6, and pg 0.13.2. Using PostgreSQL
Environment is Visual Studio 2012, ServiceStack, ASP.NET Web Application Project (followed https://github.com/ServiceStack/ServiceStack/wiki/Create-your-first-webservice ) Looking
Environment: linux x64, compiler gcc 4.x Project has following structure: static library slib --

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.