NoMethodError: undefined method `split' for nil:NilClass when deploying with Capistrano

NoMethodError: undefined method `split' for nil:NilClass when deploying with Capistrano

我正在尝试使用 Capistrano 将项目部署到暂存区。但是,我继续得到

NoMethodError: undefined method `split' for nil:NilClass

无论我尝试多少方法。

这是我的步骤:

在服务器上

RAILS_ENV=staging rake assets:clobber
RAILS_ENV=staging rake assets:precompile

本地

cap staging deploy

Command: cd /data/site/releases/20180620140908 && ( export RAILS_ENV="staging" RAILS_GROUPS="" ; ~/.rvm/bin/rvm 2.2.2@site do bundle exec rake assets:precompile )
rake aborted!
NoMethodError: undefined method `split' for nil:NilClass

感谢任何帮助!我可以提供任何人需要的任何东西来解决问题。

编辑:这是 运行 "bundle exec cap staging deploy --trace"

之后的更多错误
** Execute deploy:updated
** Invoke deploy:compile_assets (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:compile_assets
** Invoke deploy:assets:precompile (first_time)
** Execute deploy:assets:precompile
DEBUG [26939f9d] Running if test ! -d /data/site/releases/20180620153200; then echo "Directory does not exist '/data/site/releases/20180620153200'" 1>&2; false; fi as ubuntu@staging.site.com
DEBUG [26939f9d] Command: if test ! -d /data/site/releases/20180620153200; then echo "Directory does not exist '/data/site/releases/20180620153200'" 1>&2; false; fi
DEBUG [26939f9d] Finished in 0.098 seconds with exit status 0 (successful).
INFO [744200b0] Running ~/.rvm/bin/rvm 2.2.2@site do bundle exec rake assets:precompile as ubuntu@staging.site.com
DEBUG [744200b0] Command: cd /data/site/releases/20180620153200 && ( export RAILS_ENV="staging" RAILS_GROUPS="" ; ~/.rvm/bin/rvm 2.2.2@site do bundle exec rake assets:precompile )
DEBUG [744200b0]    rake aborted!
DEBUG [744200b0]    NoMethodError: undefined method `split' for nil:NilClass
DEBUG [744200b0]    /data/site/shared/bundle/ruby/2.2.0/gems/rollbar- 
1.5.3/lib/rollbar/rake.rb:23:in `patch?'
/data/site/shared/bundle/ruby/2.2.0/gems/rollbar-1.5.3/lib/rollbar/rake.rb:6:in `patch!'
/data/site/shared/bundle/ruby/2.2.0/gems/rollbar-1.5.3/lib/rollbar/rake.rb:38:in `<top (required)>'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/data/site/shared/bundle/ruby/2.2.0/gems/rollbar-1.5.3/lib/rollbar.rb:749:in `require_hooks'
/data/site/shared/bundle/ruby/2.2.0/gems/rollbar-1.5.3/lib/rollbar.rb:713:in `configure'
/data/site/releases/20180620153200/config/initializers /rollbar.rb:2:in `<top (required)>'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:652:in `block in load_config_initializer'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/notifications.rb:166:in `instrument'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:651:in `load_config_initializer'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `each'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/engine.rb:615:in `block in <class:Engine>'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `each'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:44:in `tsort_each_child'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
/data/site/releases/20180620153200/config/environment.rb:5:in `<top (required)>'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
/data/site/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:328:in `require_environment!'
/data/site/shared/bundle/ruby/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/data/site/shared/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in `block (2 levels) in define'
/data/site/shared/bundle/ruby/2.2.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
DEBUG [744200b0]    Tasks: TOP => environment
DEBUG [744200b0]    (See full trace by running task with --trace)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as ubuntu@staging.site.com: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
NoMethodError: undefined method `split' for nil:NilClass

解决方案:

我只需要更新我的 gemfile 以包含最新版本的 rake 和 rollbar

这是 rollbar gem 的记录问题。

https://github.com/rollbar/rollbar-gem/issues/411

将 gem 更新为 bundle update rollbar

就我而言,我必须运行低于命令

sudo apt-get install libmysqlclient-dev

之后效果很好。

就我而言,我试图 运行

ceedling module:create module_name

但正确的语法是

ceedling module:create[module_name]