When I make a new rails project:
当我创建一个新的rails项目时:
rails new test_app
it fails with the following:
它失败了以下内容:
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)>'
I am using:
rbenv 1.1.1 ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16] rails 5.1.4 bundler 1.16.1
我正在使用:rbenv 1.1.1 ruby 2.5.0p0(2017-12-25修订版61468)[x86_64-darwin16] rails 5.1.4 bundler 1.16.1
I suspect there is something going on with bundler but I am not sure what. I am able to run spring binstubs --all
inside the project directory but not bundle exec spring binstubs --all
我怀疑捆绑包有什么问题,但我不确定是什么。我能够运行spring binstubs --all在项目目录中,但不能捆绑exec spring binstubs --all
Top of 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 个解决方案
#1
0
I think you can try this, just replace bundle
to bundler
我想你可以尝试这个,只需将bundle替换为bundler
$ gem install bundler
$ bundler exec spring binstub --all
#1
0
I think you can try this, just replace bundle
to bundler
我想你可以尝试这个,只需将bundle替换为bundler
$ gem install bundler
$ bundler exec spring binstub --all