Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

commit 6f4c451 malfunctions with rvm's gemset

#4100

[EDIT: format correctly]

This problem happens when you use rvm and install bundler gem in one of
its gemsets(rvm's feature to switch between sets of gems to use) and
generate an application with --dev or --edge option.

Create a gemset dedicated to Rails3(say rails3b) and install bundler in it:

$ rvm use mput-head
$ rmv gemset create rails3b
$ rvm use mput-head%rails3b
$ gem install rails3b ... # installs rails3 dependencies including bundler
$ which bundle
~/.rvm/gems/mput-head%rails3b/bin/bundle

Now rails derives bundle command's path from Thor.ruby_command,
which is ~/.rvm/rubies/mput-head/bin/ruby, it expects bundle command
is ~/.rvm/rubies/mput-head/bin/bundle. So

$ ruby ~/Projects/rails/railties/bin/rails myapp --dev
<snip>
create  vendor/plugins/.gitkeep
   run  ~/.rvm/rubies/mput-head/bin/bundle install from "."
~/.rvm/gems/mput-head%rails3b/gems/thor-0.13.4/lib/thor/actions.rb:212:in ``':
No such file or directory - ~/.rvm/rubies/mput-head/bin/bundle install (Errno::ENOENT)
  from ~/.rvm/gems/mput-head%rails3b/gems/thor-0.13.4/lib/thor/actions.rb:212:in `run'
  from ~/Projects/rails/railties/lib/generators/rails/app/app_generator.rb:182:in `bundle_if_dev_or_edge'

FYI, rvm prepends some paths to PATH. They are
~/.rvm/rubies/mput-head/bin, ~/.rvm/gems/mput-head%rails3b/bin, ~/.rvm/gems/mput-head%global/bin and ~/.rvm/bin.

Any workaround?

Reported by Sakuro · March 3rd, 2010 @ 04:40 PM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to open
    • Assigned user set to José Valim
    • Milestone cleared.

    March 3rd, 2010 @ 08:11 PM

  2. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • State changed from open to resolved

    Hi Sakuro,

    It seems like Carl also found this problem. He also revert the commit to use bundle command without detecting the full path.

    So I'd mark this one as resolve. You can see the commit here: http://github.com/rails/rails/commit/7979d

    March 4th, 2010 @ 03:26 PM

  3. Sakuro
    Sakuro

    So ticket #4029 `ruby1.9 rails/railties/bin/rails foo --dev` will eventually call `bundle`, i... might be re-opened...
    Will using File.basename from the full path of the command solve both the problem?

    March 4th, 2010 @ 03:35 PM

  4. José Valim
    José Valim

    Yes, Sakuro, using File.basename will solve the problem. Can you please give a patch? (I reopened #4029 `ruby1.9 rails/railties/bin/rails foo --dev` will eventually call `bundle`, i..., so you can post the patch there).

    March 4th, 2010 @ 04:31 PM

  5. Sakuro
  6. Sakuro
  7. Jeremy Kemper