"捆绑执行弹簧binstub -all"失败

时间:2018-01-07 18:00:38

标签: ruby-on-rails ruby spring bundler

当我创建一个新的rails项目时:

rails new test_app

它失败并带有以下内容:

run  bundle exec spring binstub --all
bundler: failed to load command: spring (/Users/npresco/.rbenv/versions/2.5.0/bin/spring)
LoadError: cannot load such file -- spring-commands-rspec
  /Users/npresco/.spring.rb:1:in `require'
  /Users/npresco/.spring.rb:1:in `<top (required)>'
  /Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/commands.rb:29:in `require'
  /Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/commands.rb:29:in `<module:Spring>'
  /Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/commands.rb:4:in `<top (required)>'
  /Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/binstub.rb:138:in `require'
  /Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client/binstub.rb:138:in `call'
  /Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
  /Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
  /Users/npresco/.rbenv/versions/2.5.0/bin/spring:23:in `load'
  /Users/npresco/.rbenv/versions/2.5.0/bin/spring:23:in `<top (required)>'

我正在使用:
rbenv 1.1.1 ruby 2.5.0p0(2017-12-25修订版61468)[x86_64-darwin16] 铁轨5.1.4 bundler 1.16.1

我怀疑捆绑包有什么问题,但我不确定是什么。我可以在项目目录中运行spring binstubs --all但不能bundle exec spring binstubs --all

bundle env

的顶部
Bundler       1.16.1
  Platforms   ruby, x86_64-darwin-16
Ruby          2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
  Full Path   /Users/npresco/.rbenv/versions/2.5.0/bin/ruby
  Config Dir  /Users/npresco/.rbenv/versions/2.5.0/etc
RubyGems      2.7.3
  Gem Home    /Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0
  Gem Path    /Users/npresco/.gem/ruby/2.5.0:/Users/npresco/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0
  User Path   /Users/npresco/.gem/ruby/2.5.0
  Bin Dir     /Users/npresco/.rbenv/versions/2.5.0/bin
Tools
  Git         2.11.0 (Apple Git-81)
  RVM         not installed
  rbenv       rbenv 1.1.1

  chruby      not install

1 个答案:

答案 0 :(得分:0)

我想您可以尝试一下,只需将bundle替换为bundler

$ gem install bundler
$ bundler exec spring binstub --all