一无所获(毫不夸张:我在此异常开始发生前两个小时就部署了),cap production deploy
停止工作并抛出此错误:
Your Ruby version is 2.2.5, but your Gemfile specified 2.5.3
bundle stderr: Nothing written
除了我正在使用gemfile
和.ruby-version
中指定的2.5.3。
这是我的gemfile中的内容:
source 'https://rubygems.org'
ruby '2.5.3'
我正在使用rvm。 ruby -v
返回ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]
,并将ruby设置为global。我尝试先运行gem update bundler
,gem install bundler
,然后运行bundle install
,bundle
,然后删除gemfile.lock
。
$ bundle env
Bundler 1.17.1
Platforms ruby, x86_64-darwin-18
Ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-darwin18]
Full Path /Users/mirai/.rvm/rubies/ruby-2.5.3/bin/ruby
Config Dir /Users/mirai/.rvm/rubies/ruby-2.5.3/etc
RubyGems 2.7.8
Gem Home /Users/mirai/.rvm/gems/ruby-2.5.3@greentea-b2b
Gem Path /Users/mirai/.rvm/gems/ruby-2.5.3@greentea-
b2b:/Users/mirai/.rvm/gems/ruby-2.5.3@global
User Path /Users/mirai/.gem/ruby/2.5.0
Bin Dir /Users/mirai/.rvm/gems/ruby-2.5.3@greentea-b2b/bin
$ which -a bundle
/Users/mirai/.rvm/rubies/ruby-2.5.3/bin/bundle
/usr/local/bin/bundle
编辑:$ gem env
的输出:
RubyGems Environment:
- RUBYGEMS VERSION: 2.7.8
- RUBY VERSION: 2.5.3 (2018-10-18 patchlevel 105) [x86_64-darwin18]
- INSTALLATION DIRECTORY: /Users/mirai/.rvm/gems/ruby-2.5.3@mirai-b2b
- USER INSTALLATION DIRECTORY: /Users/mirai/.gem/ruby/2.5.0
- RUBY EXECUTABLE: /Users/mirai/.rvm/rubies/ruby-2.5.3/bin/ruby
- EXECUTABLE DIRECTORY: /Users/mirai/.rvm/gems/ruby-2.5.3@greentea-b2b/bin
- SPEC CACHE DIRECTORY: /Users/mirai/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /Users/mirai/.rvm/rubies/ruby-2.5.3/etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-18
- GEM PATHS:
- /Users/mirai/.rvm/gems/ruby-2.5.3@greentea-b2b
- /Users/mirai/.rvm/gems/ruby-2.5.3@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/"]
- "update" => "--env-shebang"
- "benchmark" => false
- "install" => "--env-shebang"
- "gem" => "-n/usr/local/bin"
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- SHELL PATH:
- /Users/mirai/.rvm/gems/ruby-2.5.3@greentea-b2b/bin
- /Users/mirai/.rvm/gems/ruby-2.5.3@global/bin
- /Users/mirai/.rvm/rubies/ruby-2.5.3/bin
- /Users/mirai/.rvm/bin
- /usr/local/opt/openssl/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /opt/local/bin
- /opt/local/sbin
- /usr/local/MacGPG2/bin
- /opt/X11/bin
我正在使用AWS。 bundle exec cap production deploy
会引发相同的错误。