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.

plugin installation rescues errors and leads to confusion

#5564

The railtie plugin command rescues errors and then reports a plugin not found issue when it is definitely not the case:

    rescue StandardError => e
      puts "Plugin not found: #{args.inspect}"
      puts e.inspect if $verbose
      exit 1
    end

For instance, you can replicate this by trying to install a fork of active_scaffold:

beet/as_test active_scaffold > script/rails plugin --verbose install git://github.com/vhochstein/active_scaffold.git
Plugins will be installed using http
git init
Initialized empty Git repository in /Users/jack/git/beet/as_test/vendor/plugins/active_scaffold/.git/
git pull --depth 1 git://github.com/vhochstein/active_scaffold.git
remote: Counting objects: 320, done.
remote: Compressing objects: 100% (288/288), done.
remote: Total 320 (delta 29), reused 195 (delta 12)
Receiving objects: 100% (320/320), 202.92 KiB, done.
Resolving deltas: 100% (29/29), done.
From git://github.com/vhochstein/active_scaffold
 * branch            HEAD       -> FETCH_HEAD
removing: .git .gitignore
Plugin not found: ["git://github.com/vhochstein/active_scaffold.git"]
#<NameError: uninitialized constant ActiveScaffold>

Only with --verbose do you see it's actually a NameError from inside the plugin. Without it people will get confused as it looks like the plugin is there, and yet "Plugin not found".

I'm opening this to create a discussion on what would be a better solution. Should be easy enough to patch (happy to write it myself) when we agree on a better way of handling this.

I would imagine a more specific rescue would work well here. I'm going to try and replicate how a plugin could be installed but actually not found. In the meantime, any other thoughts?

Edited by Rohit Arondekar for formating.

Reported by jack dempsey (jackdempsey) · September 6th, 2010 @ 07:49 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to open
    • Importance changed from to Low

    September 12th, 2010 @ 05:35 AM

  2. Rohit Arondekar
    Rohit Arondekar

    In my opinion it would be nice to know if the plugin was not found. If some other error occurs then give me a message saying that something went wrong, run with --verbose to find out more.

    September 13th, 2010 @ 06:34 AM

  3. Santiago Pastorino
    Santiago Pastorino

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:31 PM

  4. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:31 PM