在执行bundler:尝试部署Rails应用时执行capistrano的安装任务时,gem版本出错

问题描述 投票:0回答:1

我正在尝试使用Capistrano在Digital Ocean Droplet上部署我的rails应用程序。使用cap production deploy进行部署时,当达到bundler:install部分时,会出现此错误。

capistrano log

DEBUG [5a035aa4] Command: cd /home/ideabreed/noc/releases/20200405051118 && ~/.rvm/bin/rvm default do bundle install --path /home/ideabreed/noc/shared/bundle --jobs 4 --without development test --deployment --quiet
 DEBUG [5a035aa4]   Warning, new version of rvm available '1.29.10', you are using older version '1.29.9'.
You can disable this warning with:   echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with:     echo rvm_autoupdate_flag=2 >> ~/.rvmrc
You can update manually with:        rvm get VERSION                         (e.g. 'rvm get stable')

 DEBUG [5a035aa4]   [DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set deployment 'true'`, and stop using this flag
 DEBUG [5a035aa4]   [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set path '/home/ideabreed/noc/shared/bundle'`, and stop using this flag
 DEBUG [5a035aa4]   [DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'development test'`, and stop using this flag
 DEBUG [5a035aa4]   Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/home/ideabreed/noc/shared/bundle/ruby/2.6.0/gems/sassc-2.2.1/ext
/home/ideabreed/.rvm/rubies/ruby-2.6.3/bin/ruby -I
/home/ideabreed/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0 -r
./siteconf20200405-18259-1q3n44y.rb extconf.rb
creating Makefile

current directory:
/home/ideabreed/noc/shared/bundle/ruby/2.6.0/gems/sassc-2.2.1/ext
make "DESTDIR=" clean

current directory:
/home/ideabreed/noc/shared/bundle/ruby/2.6.0/gems/sassc-2.2.1/ext
make "DESTDIR="
compiling ./libsass/src/fn_numbers.cpp
compiling ./libsass/src/lexer.cpp
compiling ./libsass/src/memory/SharedPtr.cpp
compiling ./libsass/src/c99func.c
compiling ./libsass/src/plugins.cpp
compiling ./libsass/src/ast_supports.cpp
compiling ./libsass/src/c2ast.cpp
compiling ./libsass/src/emitter.cpp
compiling ./libsass/src/sass_util.cpp
compiling ./libsass/src/ast.cpp
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
Makefile:235: recipe for target 'ast.o' failed
make: *** [ast.o] Error 4

make failed, exit code 2

Gem files will remain installed in
/home/ideabreed/noc/shared/bundle/ruby/2.6.0/gems/sassc-2.2.1 for inspection.
Results logged to
/home/ideabreed/noc/shared/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/sassc-2.2.1/gem_make.out

An error occurred while installing sassc (2.2.1), and Bundler cannot continue.
Make sure that `gem install sassc -v '2.2.1' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  rails_admin was resolved to 2.0.2, which depends on
    sassc-rails was resolved to 2.1.2, which depends on
      sassc

我已按照建议完成gem install sassc -v '2.2.1' --source 'https://rubygems.org/',但没有效果。我不知道是什么原因导致此错误,因为我已经安装了上述版本的gem文件。

Gemfile

source 'https://rubygems.org'
git_source(:github) {|repo| "https://github.com/#{repo}.git"}

ruby '2.6.3'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.2', '>= 6.0.2.2'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false
gem 'slim-rails'
gem 'devise'
gem 'rails_admin', '~> 2.0.2'
gem 'nepali_date_converter'
gem 'ransack'
gem "sassc-rails", "~> 2.1.2"

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'pry-rails'
  gem 'annotate'
  gem 'any_login'
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  gem 'rails_db'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'

  gem 'capistrano', require: false
  gem 'capistrano-rvm', require: false
  gem 'capistrano-rails', require: false
  gem 'capistrano-bundler', require: false
  gem 'capistrano3-puma', require: false
  gem 'capistrano-rails-db'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

group :production do
  gem "simple_form"
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actioncable (6.0.2.2)
      actionpack (= 6.0.2.2)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (6.0.2.2)
      actionpack (= 6.0.2.2)
      activejob (= 6.0.2.2)
      activerecord (= 6.0.2.2)
      activestorage (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      mail (>= 2.7.1)
    actionmailer (6.0.2.2)
      actionpack (= 6.0.2.2)
      actionview (= 6.0.2.2)
      activejob (= 6.0.2.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (6.0.2.2)
      actionview (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      rack (~> 2.0, >= 2.0.8)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (6.0.2.2)
      actionpack (= 6.0.2.2)
      activerecord (= 6.0.2.2)
      activestorage (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      nokogiri (>= 1.8.5)
    actionview (6.0.2.2)
      activesupport (= 6.0.2.2)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (6.0.2.2)
      activesupport (= 6.0.2.2)
      globalid (>= 0.3.6)
    activemodel (6.0.2.2)
      activesupport (= 6.0.2.2)
    activemodel-serializers-xml (1.0.2)
      activemodel (> 5.x)
      activesupport (> 5.x)
      builder (~> 3.1)
    activerecord (6.0.2.2)
      activemodel (= 6.0.2.2)
      activesupport (= 6.0.2.2)
    activestorage (6.0.2.2)
      actionpack (= 6.0.2.2)
      activejob (= 6.0.2.2)
      activerecord (= 6.0.2.2)
      marcel (~> 0.3.1)
    activesupport (6.0.2.2)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
      zeitwerk (~> 2.2)
    addressable (2.7.0)
      public_suffix (>= 2.0.2, < 5.0)
    airbrussh (1.4.0)
      sshkit (>= 1.6.1, != 1.7.0)
    annotate (3.1.1)
      activerecord (>= 3.2, < 7.0)
      rake (>= 10.4, < 14.0)
    any_login (1.4.3)
      rails (>= 4.2.7)
    bcrypt (3.1.13)
    bindex (0.8.1)
    bootsnap (1.4.6)
      msgpack (~> 1.0)
    builder (3.2.4)
    byebug (11.1.1)
    capistrano (3.12.1)
      airbrussh (>= 1.0.0)
      i18n
      rake (>= 10.0.0)
      sshkit (>= 1.9.0)
    capistrano-bundler (1.6.0)
      capistrano (~> 3.1)
    capistrano-rails (1.4.0)
      capistrano (~> 3.1)
      capistrano-bundler (~> 1.1)
    capistrano-rails-db (0.0.2)
      capistrano-rails (~> 1.1)
    capistrano-rvm (0.1.2)
      capistrano (~> 3.0)
      sshkit (~> 1.2)
    capistrano3-puma (4.0.0)
      capistrano (~> 3.7)
      capistrano-bundler
      puma (~> 4.0)
    capybara (3.32.0)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (~> 1.5)
      xpath (~> 3.2)
    childprocess (3.0.0)
    coderay (1.1.2)
    concurrent-ruby (1.1.6)
    crass (1.0.6)
    devise (4.7.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0)
      responders
      warden (~> 1.2.3)
    erubi (1.9.0)
    ffi (1.12.2)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    haml (5.1.2)
      temple (>= 0.8.0)
      tilt
    i18n (1.8.2)
      concurrent-ruby (~> 1.0)
    jbuilder (2.10.0)
      activesupport (>= 5.0.0)
    jquery-rails (4.3.5)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (6.0.1)
      railties (>= 3.2.16)
    kaminari (1.2.0)
      activesupport (>= 4.1.0)
      kaminari-actionview (= 1.2.0)
      kaminari-activerecord (= 1.2.0)
      kaminari-core (= 1.2.0)
    kaminari-actionview (1.2.0)
      actionview
      kaminari-core (= 1.2.0)
    kaminari-activerecord (1.2.0)
      activerecord
      kaminari-core (= 1.2.0)
    kaminari-core (1.2.0)
    listen (3.1.5)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
      ruby_dep (~> 1.2)
    loofah (2.4.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    method_source (1.0.0)
    mimemagic (0.3.4)
    mini_mime (1.0.2)
    mini_portile2 (2.4.0)
    minitest (5.14.0)
    msgpack (1.3.3)
    nepali_date_converter (1.0.0)
    nested_form (0.3.2)
    net-scp (2.0.0)
      net-ssh (>= 2.6.5, < 6.0.0)
    net-ssh (5.2.0)
    nio4r (2.5.2)
    nokogiri (1.10.9)
      mini_portile2 (~> 2.4.0)
    orm_adapter (0.5.0)
    pg (1.2.3)
    polyamorous (2.3.2)
      activerecord (>= 5.2.1)
    pry (0.13.0)
      coderay (~> 1.1)
      method_source (~> 1.0)
    pry-rails (0.3.9)
      pry (>= 0.10.4)
    public_suffix (4.0.3)
    puma (4.3.3)
      nio4r (~> 2.0)
    rack (2.2.2)
    rack-pjax (1.1.0)
      nokogiri (~> 1.5)
      rack (>= 1.1)
    rack-proxy (0.6.5)
      rack
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (6.0.2.2)
      actioncable (= 6.0.2.2)
      actionmailbox (= 6.0.2.2)
      actionmailer (= 6.0.2.2)
      actionpack (= 6.0.2.2)
      actiontext (= 6.0.2.2)
      actionview (= 6.0.2.2)
      activejob (= 6.0.2.2)
      activemodel (= 6.0.2.2)
      activerecord (= 6.0.2.2)
      activestorage (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      bundler (>= 1.3.0)
      railties (= 6.0.2.2)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.3.0)
      loofah (~> 2.3)
    rails_admin (2.0.2)
      activemodel-serializers-xml (>= 1.0)
      builder (~> 3.1)
      haml (>= 4.0, < 6)
      jquery-rails (>= 3.0, < 5)
      jquery-ui-rails (>= 5.0, < 7)
      kaminari (>= 0.14, < 2.0)
      nested_form (~> 0.3)
      rack-pjax (>= 0.7)
      rails (>= 5.0, < 7)
      remotipart (~> 1.3)
      sassc-rails (>= 1.3, < 3)
    rails_db (2.3.1)
      activerecord
      kaminari
      rails (>= 5.0.0)
      ransack (>= 2.3.2)
      simple_form (>= 5.0.1)
      terminal-table
    railties (6.0.2.2)
      actionpack (= 6.0.2.2)
      activesupport (= 6.0.2.2)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.20.3, < 2.0)
    rake (13.0.1)
    ransack (2.3.2)
      activerecord (>= 5.2.1)
      activesupport (>= 5.2.1)
      i18n
      polyamorous (= 2.3.2)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.1)
      ffi (~> 1.0)
    regexp_parser (1.7.0)
    remotipart (1.4.4)
    responders (3.0.0)
      actionpack (>= 5.0)
      railties (>= 5.0)
    ruby_dep (1.5.0)
    rubyzip (2.3.0)
    sass-rails (6.0.0)
      sassc-rails (~> 2.1, >= 2.1.1)
    sassc (2.2.1)
      ffi (~> 1.9)
    sassc-rails (2.1.2)
      railties (>= 4.0.0)
      sassc (>= 2.0)
      sprockets (> 3.0)
      sprockets-rails
      tilt
    selenium-webdriver (3.142.7)
      childprocess (>= 0.5, < 4.0)
      rubyzip (>= 1.2.2)
    simple_form (5.0.2)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
    slim (4.0.1)
      temple (>= 0.7.6, < 0.9)
      tilt (>= 2.0.6, < 2.1)
    slim-rails (3.2.0)
      actionpack (>= 3.1)
      railties (>= 3.1)
      slim (>= 3.0, < 5.0)
    spring (2.1.0)
    spring-watcher-listen (2.0.1)
      listen (>= 2.7, < 4.0)
      spring (>= 1.2, < 3.0)
    sprockets (4.0.0)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sshkit (1.21.0)
      net-scp (>= 1.1.2)
      net-ssh (>= 2.8.0)
    temple (0.8.2)
    terminal-table (1.8.0)
      unicode-display_width (~> 1.1, >= 1.1.1)
    thor (1.0.1)
    thread_safe (0.3.6)
    tilt (2.0.10)
    turbolinks (5.2.1)
      turbolinks-source (~> 5.2)
    turbolinks-source (5.2.0)
    tzinfo (1.2.6)
      thread_safe (~> 0.1)
    unicode-display_width (1.7.0)
    warden (1.2.8)
      rack (>= 2.0.6)
    web-console (4.0.1)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webdrivers (4.2.0)
      nokogiri (~> 1.6)
      rubyzip (>= 1.3.0)
      selenium-webdriver (>= 3.0, < 4.0)
    webpacker (4.2.2)
      activesupport (>= 4.2)
      rack-proxy (>= 0.6.1)
      railties (>= 4.2)
    websocket-driver (0.7.1)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.4)
    xpath (3.2.0)
      nokogiri (~> 1.8)
    zeitwerk (2.3.0)

PLATFORMS
  ruby

DEPENDENCIES
  annotate
  any_login
  bootsnap (>= 1.4.2)
  byebug
  capistrano
  capistrano-bundler
  capistrano-rails
  capistrano-rails-db
  capistrano-rvm
  capistrano3-puma
  capybara (>= 2.15)
  devise
  jbuilder (~> 2.7)
  listen (>= 3.0.5, < 3.2)
  nepali_date_converter
  pg (>= 0.18, < 2.0)
  pry-rails
  puma (~> 4.1)
  rails (~> 6.0.2, >= 6.0.2.2)
  rails_admin (~> 2.0.2)
  rails_db
  ransack
  sass-rails (>= 6)
  sassc-rails (~> 2.1.2)
  selenium-webdriver
  simple_form
  slim-rails
  spring
  spring-watcher-listen (~> 2.0.0)
  turbolinks (~> 5)
  tzinfo-data
  web-console (>= 3.3.0)
  webdrivers
  webpacker (~> 4.0)

RUBY VERSION
   ruby 2.6.3p62

BUNDLED WITH
   2.1.1

需要帮助解决此问题。

ruby-on-rails capistrano bundler
1个回答
0
投票

我今天遇到了同样的错误。

我的服务器没有足够的RAM来编译sassc gem。我将RAM从256 MB提升到512 MB,它可以正常工作。

© www.soinside.com 2019 - 2024. All rights reserved.