执行bundle exec时出错

时间:2011-11-01 05:29:29

标签: ruby-on-rails ruby ruby-on-rails-3 rubygems ruby-on-rails-3.1

运行bundle exec时出现此错误

/usr/lib/ruby/gems/1.8/gems/bundler-1.0.20/lib/bundler/cli.rb:344:in `exec': wrong number of arguments (ArgumentError)
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.20/lib/bundler/cli.rb:344:in `exec'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.20/lib/bundler/vendor/thor/task.rb:22:in `send'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.20/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.20/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.20/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.20/lib/bundler/vendor/thor/base.rb:386:in `start'
from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.20/bin/bundle:13
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19

usr / lib / ruby​​ / gems / 1.8 / gems / bundler-1.0.20 / lib / bundler / cli.rb~344中的代码行如下所示。似乎有一些争论寻求!!!

 def exec(*)
  ARGV.shift # remove "exec"

  Bundler.setup

  begin
    # Run
    Kernel.exec(*ARGV)
  rescue Errno::EACCES
    Bundler.ui.error "bundler: not executable: #{ARGV.first}"
    exit 126
  rescue Errno::ENOENT
    Bundler.ui.error "bundler: command not found: #{ARGV.first}"
    Bundler.ui.warn  "Install missing gem executables with `bundle install`"
    exit 127
  end
end

desc "config NAME [VALUE]", "retrieve or set a configuration value"
long_desc <<-D
  Retrieves or sets a configuration value. If only parameter is provided, retrieve the value. If two parameters are provided, replace the
  existing value with the newly provided one.

  By default, setting a configuration value sets it for all projects
  on the machine.

  If a global setting is superceded by local configuration, this command
  will show the current value, as well as any superceded values and
  where they were specified.
D

1 个答案:

答案 0 :(得分:2)

如果您只是在没有其他参数的情况下运行裸bundle exec,则行:

Kernel.exec(*ARGV)

没有足够的信息来执行任何操作。您需要向bundle exec {{1}}提供命令,如here所示。

相关问题