Attempting to deploy this Rails API and keep sticking when EB goes to install the PG gem. I tried posting on the forums but got no help. The repo lives here: https://github.com/horaciovelvetine/devHub
So far I have tried:
Removing the specific gem requirement
gem "pg"
-instead of-
gem "pg", "~> 1.4.1"
Zipping my deployment w/ and wo/ a gemfile.lock
Unfortunately that's about as far as I got as googling only turned up threads that seem to be very aged:
Set up the pg gem - postgresql in development
Ruby On Rails: bundle fails...
Error on install
The last link has a sudo command that I didn't attempt as Im not even sure where, and tend to be weary of running sudo commands w/o understanding what I'm commanding the sudo to do.
Ruby Version: 3.0.4 Rails Version: 7.0.3
GEMFILE:
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.0.4"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.3"
# Use postgresql as the database for Active Record
gem "pg", "~> 1.4.1"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem "rack-cors"
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end
group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
gem 'pry', '~> 0.13.1'
gem 'dotenv-rails', groups: [:development, :test]
gem 'solargraph', group: :development
GEMFILE.LOCK:
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.3)
actionpack (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activesupport (= 7.0.3)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.3)
actionview (= 7.0.3)
activesupport (= 7.0.3)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.3)
actionpack (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.3)
activesupport (= 7.0.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.3)
activesupport (= 7.0.3)
globalid (>= 0.3.6)
activemodel (7.0.3)
activesupport (= 7.0.3)
activerecord (7.0.3)
activemodel (= 7.0.3)
activesupport (= 7.0.3)
activestorage (7.0.3)
actionpack (= 7.0.3)
activejob (= 7.0.3)
activerecord (= 7.0.3)
activesupport (= 7.0.3)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
ast (2.4.2)
backport (1.2.0)
benchmark (0.2.0)
bootsnap (1.12.0)
msgpack (~> 1.2)
builder (3.2.4)
coderay (1.1.3)
concurrent-ruby (1.1.10)
crass (1.0.6)
debug (1.5.0)
irb (>= 1.3.6)
reline (>= 0.2.7)
diff-lcs (1.5.0)
digest (3.1.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
e2mmap (0.1.0)
erubi (1.10.0)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
io-console (0.5.11)
irb (1.4.1)
reline (>= 0.3.0)
jaro_winkler (1.5.4)
json (2.6.2)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
loofah (2.18.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.16.2)
msgpack (1.5.3)
net-imap (0.2.3)
digest
net-protocol
strscan
net-pop (0.1.1)
digest
net-protocol
timeout
net-protocol (0.1.3)
timeout
net-smtp (0.3.1)
digest
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.13.6)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.6-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.6-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.0)
ast (~> 2.4.1)
pg (1.4.1)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
puma (5.6.4)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.4)
rack-test (2.0.2)
rack (>= 1.3)
rails (7.0.3)
actioncable (= 7.0.3)
actionmailbox (= 7.0.3)
actionmailer (= 7.0.3)
actionpack (= 7.0.3)
actiontext (= 7.0.3)
actionview (= 7.0.3)
activejob (= 7.0.3)
activemodel (= 7.0.3)
activerecord (= 7.0.3)
activestorage (= 7.0.3)
activesupport (= 7.0.3)
bundler (>= 1.15.0)
railties (= 7.0.3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
railties (7.0.3)
actionpack (= 7.0.3)
activesupport (= 7.0.3)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.5.0)
reline (0.3.1)
io-console (~> 0.5)
reverse_markdown (2.1.1)
nokogiri
rexml (3.2.5)
rubocop (1.31.1)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.18.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.18.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
solargraph (0.45.0)
backport (~> 1.2)
benchmark
bundler (>= 1.17.2)
diff-lcs (~> 1.4)
e2mmap
jaro_winkler (~> 1.5)
kramdown (~> 2.3)
kramdown-parser-gfm (~> 1.1)
parser (~> 3.0)
reverse_markdown (>= 1.0.5, < 3)
rubocop (>= 0.52)
thor (~> 1.0)
tilt (~> 2.0)
yard (~> 0.9, >= 0.9.24)
strscan (3.0.3)
thor (1.2.1)
tilt (2.0.10)
timeout (0.3.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (2.2.0)
webrick (1.7.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yard (0.9.28)
webrick (~> 1.7.0)
zeitwerk (2.6.0)
PLATFORMS
ruby
x86_64-darwin-21
x86_64-linux
DEPENDENCIES
bootsnap
debug
dotenv-rails
pg
pry (~> 0.13.1)
puma (~> 5.0)
rails (~> 7.0.3)
solargraph
tzinfo-data
RUBY VERSION
ruby 3.0.4p208
BUNDLED WITH
2.2.33
Database.yml: (config)
# PostgreSQL. Versions 9.3 and up are supported.
#
# Install the pg driver:
# gem install pg
# On macOS with Homebrew:
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
# On macOS with MacPorts:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem 'pg'
#
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: devHub_API_development
# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# the same name as the operating system user running Rails.
#username: devHub_API
# The password associated with the postgres role (username).
#password:
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
#host: localhost
# The TCP port the server listens on. Defaults to 5432.
# If your server runs on a different port number, change accordingly.
#port: 5432
# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public
# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
# Defaults to warning.
#min_messages: notice
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: devHub_API_test
# As with config/credentials.yml, you never want to store sensitive information,
# like your database password, in your source code. If your source code is
# ever seen by anyone, they now have access to your database.
#
# Instead, provide the password or a full connection URL as an environment
# variable when you boot the app. For example:
#
# DATABASE_URL="postgres://myuser:mypass#localhost/somedatabase"
#
# If the connection URL is provided in the special DATABASE_URL environment
# variable, Rails will automatically merge its configuration values on top of
# the values provided in this file. Alternatively, you can specify a connection
# URL environment variable explicitly:
#
production:
url: <%= ENV['DATABASE_URL'] %>
#
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full overview on how database connection configuration can be specified.
#
# production:
# <<: *default
# database: devHub_API_production
# username: devHub_API
# password: <%= ENV['DEVHUB_API_DATABASE_PASSWORD'] %>
I'm more than happy to provide any additional details, since I'm so lost on this issue I'm not even 100% sure what info/files would be helpful to provide. More than anything I'd really love to understand the what and why here!
Error Log:
```
----------------------------------------
/var/log/eb-engine.log
----------------------------------------
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:26:in
`build'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:164:in
`build_extension'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:198:in
`block in build_extensions'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:195:in
`each'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/ext/builder.rb:195:in
`build_extensions'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/rubygems/installer.rb:851:in
`build_extensions'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/rubygems_gem_installer.rb:28:in
`install'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/source/rubygems.rb:204:in
`install'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:54:in
`install'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:171:in
`install_serially'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:97:in
`call'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer/parallel_installer.rb:71:in
`call'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:259:in
`install_in_parallel'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:209:in
`install'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:89:in
`block in run'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/process_lock.rb:12:in
`block in lock'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/process_lock.rb:9:in
`open'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/process_lock.rb:9:in
`lock'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:71:in
`run'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/installer.rb:23:in
`install'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/cli/install.rb:62:in
`run'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:255:in `block
in install'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/settings.rb:131:in
`temporary'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:254:in
`install'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in
`run'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in
`invoke_command'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in
`dispatch'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:31:in
`dispatch'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in
`start'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/cli.rb:25:in `start'
/opt/rubies/ruby-3.0.4/lib/ruby/gems/3.0.0/gems/bundler-2.3.15/exe/bundle:48:in
`block in <top (required)>'
/opt/rubies/ruby-3.0.4/lib/ruby/site_ruby/3.0.0/bundler/friendly_errors.rb:117:in
`with_friendly_errors'
/opt/rubies/ruby-3.0.4/lib/ruby/gems/3.0.0/gems/bundler-2.3.15/exe/bundle:36:in
`<top (required)>'
/opt/elasticbeanstalk/.rbenv/versions/3.0.4/bin/bundle:25:in `load'
/opt/elasticbeanstalk/.rbenv/versions/3.0.4/bin/bundle:25:in `<main>'
An error occurred while installing pg (1.4.1), and Bundler cannot continue.
In Gemfile:
pg
2022/07/06 16:54:07.332933 [INFO] Executing cleanup logic
2022/07/06 16:54:07.333069 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment failed to install dependency gems that you defined in 'Gemfile'. For details, see 'eb-engine.log'. The deployment failed.","timestamp":1657126447332,"severity":"ERROR"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1657126447332,"severity":"ERROR"}]}]}
2022/07/06 16:54:07.333247 [INFO] Platform Engine finished execution on command: app-deploy
2022/07/06 16:54:53.559449 [INFO] Starting...
2022/07/06 16:54:53.559495 [INFO] Starting EBPlatform-PlatformEngine
2022/07/06 16:54:53.559514 [INFO] reading event message file
2022/07/06 16:54:53.559664 [INFO] Engine received EB command cfn-hup-exec
2022/07/06 16:54:53.678576 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:489110557771:stack/awseb-e-hi2wpdaddr-stack/1adae7c0-fd44-11ec-8165-0a0fb8a2f08b -r AWSEBAutoScalingGroup --region us-east-1
2022/07/06 16:54:54.008860 [INFO] Running command /bin/sh -c /opt/aws/bin/cfn-get-metadata -s arn:aws:cloudformation:us-east-1:489110557771:stack/awseb-e-hi2wpdaddr-stack/1adae7c0-fd44-11ec-8165-0a0fb8a2f08b -r AWSEBBeanstalkMetadata --region us-east-1
2022/07/06 16:54:54.298990 [INFO] checking whether command tail-log is applicable to this instance...
2022/07/06 16:54:54.299003 [INFO] this command is applicable to the instance, thus instance should execute command
2022/07/06 16:54:54.299008 [INFO] Engine command: (tail-log)
2022/07/06 16:54:54.299061 [INFO] Executing instruction: GetTailLogs
2022/07/06 16:54:54.299066 [INFO] Tail Logs...
2022/07/06 16:54:54.299307 [INFO] Running command /bin/sh -c tail -n 100 /var/log/web.stdout.log
2022/07/06 16:54:54.301041 [INFO] Running command /bin/sh -c tail -n 100 /var/log/eb-engine.log
Thank you so much for your time/help! James
Related
I'm trying to containerize my Rails app and boot it via docker-compose. The app builds fine via docker-compose build but when trying to boot, it fails:
$ docker-compose up
Starting postgres ... done
Recreating puma ... done
Attaching to postgres, puma
postgres |
postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres |
postgres | 2022-05-04 21:45:30.012 UTC [1] LOG: starting PostgreSQL 14.1 (Debian 14.1-1.pgdg110+1) on aarch64-unknown-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
postgres | 2022-05-04 21:45:30.012 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres | 2022-05-04 21:45:30.012 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres | 2022-05-04 21:45:30.016 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres | 2022-05-04 21:45:30.075 UTC [28] LOG: database system was shut down at 2022-05-04 21:31:01 UTC
postgres | 2022-05-04 21:45:30.119 UTC [1] LOG: database system is ready to accept connections
puma | /usr/local/bundle/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require': cannot load such file -- nokogiri (LoadError)
I'm specifically struggling with this last line:
1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:15:in `require': cannot load such file -- nokogiri (LoadError)
My Dockerfile is as follows:
# syntax=docker/dockerfile:1
FROM ruby:3.0.4
RUN apt-get update && apt-get install -y nodejs postgresql-client zlib1g-dev liblzma-dev patch
RUN gem install nokogiri --platform=ruby
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000
# Configure the main process to run when running the image
CMD ["rails", "server", "-b", "0.0.0.0"]
I've tried following the recommendations here, noting that Docker is building its images with Debian. But, this doesn't seem to work.
I also came across this post, but in this case I'm not building with Alpine Linux, I'm using the default ruby image image which appears to run on Debian. That, I'm also attempting to boot on my M1 macOS (11.3.1) machine.
Any recommendations or tips here? I'm relatively new to building Rails apps via Docker and any tips would be much appreciated 🙇🏻.
Lastly, here are my Gemfile and Gemfile.lock files respectively:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '3.0.4'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.4', '>= 6.1.4.4'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
gem "sidekiq"
gem "httparty"
gem "bootstrap"
gem "sidekiq-scheduler"
# 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.4', require: false
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 'dotenv-rails'
end
group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 4.1.0'
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'rack-mini-profiler', '~> 2.0'
gem 'listen', '~> 3.3'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 3.26'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.4.6)
actionpack (= 6.1.4.6)
activesupport (= 6.1.4.6)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.6)
actionpack (= 6.1.4.6)
activejob (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
mail (>= 2.7.1)
actionmailer (6.1.4.6)
actionpack (= 6.1.4.6)
actionview (= 6.1.4.6)
activejob (= 6.1.4.6)
activesupport (= 6.1.4.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.4.6)
actionview (= 6.1.4.6)
activesupport (= 6.1.4.6)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.4.6)
actionpack (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
nokogiri (>= 1.8.5)
actionview (6.1.4.6)
activesupport (= 6.1.4.6)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.4.6)
activesupport (= 6.1.4.6)
globalid (>= 0.3.6)
activemodel (6.1.4.6)
activesupport (= 6.1.4.6)
activerecord (6.1.4.6)
activemodel (= 6.1.4.6)
activesupport (= 6.1.4.6)
activestorage (6.1.4.6)
actionpack (= 6.1.4.6)
activejob (= 6.1.4.6)
activerecord (= 6.1.4.6)
activesupport (= 6.1.4.6)
marcel (~> 1.0.0)
mini_mime (>= 1.1.0)
activesupport (6.1.4.6)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
autoprefixer-rails (10.4.0.0)
execjs (~> 2)
bindex (0.8.1)
bootsnap (1.10.3)
msgpack (~> 1.2)
bootstrap (5.1.3)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.9.3, < 3)
sassc-rails (>= 2.0.0)
builder (3.2.4)
byebug (11.1.3)
capybara (3.36.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (4.1.0)
concurrent-ruby (1.1.9)
connection_pool (2.2.5)
crass (1.0.6)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
railties (>= 3.2)
e2mmap (0.1.0)
erubi (1.10.0)
et-orbi (1.2.7)
tzinfo
execjs (2.8.1)
ffi (1.15.5)
fugit (1.5.3)
et-orbi (~> 1, >= 1.2.7)
raabro (~> 1.4)
globalid (1.0.0)
activesupport (>= 5.0)
httparty (0.20.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.14.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.1115)
mini_mime (1.1.2)
minitest (5.15.0)
msgpack (1.4.5)
multi_xml (0.6.0)
nio4r (2.5.8)
nokogiri (1.13.3-arm64-darwin)
racc (~> 1.4)
pg (1.3.3)
popper_js (2.9.3)
public_suffix (4.0.6)
puma (5.6.2)
nio4r (~> 2.0)
raabro (1.4.0)
racc (1.6.0)
rack (2.2.3)
rack-mini-profiler (2.3.4)
rack (>= 1.2.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.4.6)
actioncable (= 6.1.4.6)
actionmailbox (= 6.1.4.6)
actionmailer (= 6.1.4.6)
actionpack (= 6.1.4.6)
actiontext (= 6.1.4.6)
actionview (= 6.1.4.6)
activejob (= 6.1.4.6)
activemodel (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
bundler (>= 1.15.0)
railties (= 6.1.4.6)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (6.1.4.6)
actionpack (= 6.1.4.6)
activesupport (= 6.1.4.6)
method_source
rake (>= 0.13)
thor (~> 1.0)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (4.6.0)
regexp_parser (2.2.1)
rexml (3.2.5)
rubyzip (2.3.2)
rufus-scheduler (3.8.1)
fugit (~> 1.1, >= 1.1.6)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
sidekiq (6.4.1)
connection_pool (>= 2.2.2)
rack (~> 2.0)
redis (>= 4.2.0)
sidekiq-scheduler (3.1.1)
e2mmap
redis (>= 3, < 5)
rufus-scheduler (~> 3.2)
sidekiq (>= 3)
thwait
tilt (>= 1.4.0)
spring (3.1.1)
sprockets (4.0.3)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
thor (1.2.1)
thwait (0.2.0)
e2mmap
tilt (2.0.10)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
web-console (4.2.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.0.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.5.4)
PLATFORMS
aarch64-linux
arm64-darwin-20
DEPENDENCIES
bootsnap (>= 1.4.4)
bootstrap
byebug
capybara (>= 3.26)
dotenv-rails
httparty
jbuilder (~> 2.7)
listen (~> 3.3)
pg (~> 1.1)
puma (~> 5.0)
rack-mini-profiler (~> 2.0)
rails (~> 6.1.4, >= 6.1.4.4)
sass-rails (>= 6)
selenium-webdriver
sidekiq
sidekiq-scheduler
spring
tzinfo-data
web-console (>= 4.1.0)
webdrivers
RUBY VERSION
ruby 3.0.4p208
BUNDLED WITH
2.2.33
For anyone that runs into this same issue, I had to perform the below locally and rebuild the container:
bundle lock --add-platform x86_64-linux
bundle install # resolve dependencies for platform-specific gems
As stated here: https://nokogiri.org/tutorials/installing_nokogiri.html#supported-platforms
tl;dr: RTFM.
I've been working on dockerizing a simple Ruby on Rails API with a SQL database, and I've been encountering the following error:
ERROR: It looks like you're trying to use Nokogiri as a precompiled native gem on a system with glibc < 2.17:
/lib/aarch64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/3.0/nokogiri.so) - /usr/local/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/3.0/nokogiri.so
If that's the case, then please install Nokogiri via the `ruby` platform gem: gem install nokogiri --platform=ruby or: bundle config set force_ruby_platform true
Please visit https://nokogiri.org/tutorials/installing_nokogiri.html for more help.
Here's my dockerfile
FROM ruby:3.0.0
RUN apt-get update && apt-get install -y build-essential
RUN apt-get install default-mysql-client -y
RUN mkdir /task
WORKDIR /task
ADD Gemfile /task/Gemfile
ADD Gemfile.lock /task/Gemfile.lock
RUN bundle install
ADD . /task
And here's my compose file
services:
db:
platform: linux/x86_64
image: mysql:8.0.20
restart: always
environment:
MYSQL_USER: root
MYSQL_DB: chat_system
MYSQL_HOST: db
MYSQL_ROOT_PASSWORD: password
ports:
- "3307:3306"
app:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- ".:/noteapp"
ports:
- "3001:3000"
depends_on:
- db
links:
- db
environment:
DB_USER: root
DB_NAME: chat_system
DB_PASSWORD: password
DB_HOST: db
Gemfile
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby "3.0.0"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.2", ">= 7.0.2.3"
# Use mysql as the database for Active Record
gem "mysql2", "~> 0.5"
# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
# gem "jbuilder"
# Use Redis adapter to run Action Cable in production
# gem "redis", "~> 4.0"
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
# gem "kredis"
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", require: false
gem 'redis'
gem 'redis-namespace'
gem 'redis-rails'
gem 'redis-rack-cache'
gem 'sneakers'
gem 'bunny'
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
# gem "rack-cors"
group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
end
group :development do
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
# gem "spring"
end
Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
actioncable (7.0.2.3)
actionpack (= 7.0.2.3)
activesupport (= 7.0.2.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.2.3)
actionpack (= 7.0.2.3)
activejob (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.0.2.3)
actionpack (= 7.0.2.3)
actionview (= 7.0.2.3)
activejob (= 7.0.2.3)
activesupport (= 7.0.2.3)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (7.0.2.3)
actionview (= 7.0.2.3)
activesupport (= 7.0.2.3)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.2.3)
actionpack (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.0.2.3)
activesupport (= 7.0.2.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.2.3)
activesupport (= 7.0.2.3)
globalid (>= 0.3.6)
activemodel (7.0.2.3)
activesupport (= 7.0.2.3)
activerecord (7.0.2.3)
activemodel (= 7.0.2.3)
activesupport (= 7.0.2.3)
activestorage (7.0.2.3)
actionpack (= 7.0.2.3)
activejob (= 7.0.2.3)
activerecord (= 7.0.2.3)
activesupport (= 7.0.2.3)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (7.0.2.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
amq-protocol (2.3.2)
bootsnap (1.11.1)
msgpack (~> 1.2)
builder (3.2.4)
bunny (2.19.0)
amq-protocol (~> 2.3, >= 2.3.1)
sorted_set (~> 1, >= 1.0.2)
concurrent-ruby (1.1.10)
crass (1.0.6)
debug (1.5.0)
irb (>= 1.3.6)
reline (>= 0.2.7)
digest (3.1.0)
erubi (1.10.0)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.10.0)
concurrent-ruby (~> 1.0)
io-console (0.5.11)
irb (1.4.1)
reline (>= 0.3.0)
loofah (2.16.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
minitest (5.15.0)
msgpack (1.5.1)
net-imap (0.2.3)
digest
net-protocol
strscan
net-pop (0.1.1)
digest
net-protocol
timeout
net-protocol (0.1.3)
timeout
net-smtp (0.3.1)
digest
net-protocol
timeout
nio4r (2.5.8)
nokogiri (1.13.3-arm64-darwin)
racc (~> 1.4)
puma (5.6.4)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.3)
rack-cache (1.13.0)
rack (>= 0.4)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.2.3)
actioncable (= 7.0.2.3)
actionmailbox (= 7.0.2.3)
actionmailer (= 7.0.2.3)
actionpack (= 7.0.2.3)
actiontext (= 7.0.2.3)
actionview (= 7.0.2.3)
activejob (= 7.0.2.3)
activemodel (= 7.0.2.3)
activerecord (= 7.0.2.3)
activestorage (= 7.0.2.3)
activesupport (= 7.0.2.3)
bundler (>= 1.15.0)
railties (= 7.0.2.3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (7.0.2.3)
actionpack (= 7.0.2.3)
activesupport (= 7.0.2.3)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (12.3.3)
rbtree (0.4.5)
redis (4.6.0)
redis-actionpack (5.3.0)
actionpack (>= 5, < 8)
redis-rack (>= 2.1.0, < 3)
redis-store (>= 1.1.0, < 2)
redis-activesupport (5.3.0)
activesupport (>= 3, < 8)
redis-store (>= 1.3, < 2)
redis-namespace (1.8.2)
redis (>= 3.0.4)
redis-rack (2.1.4)
rack (>= 2.0.8, < 3)
redis-store (>= 1.2, < 2)
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
redis-store (>= 1.6, < 2)
redis-rails (5.0.2)
redis-actionpack (>= 5.0, < 6)
redis-activesupport (>= 5.0, < 6)
redis-store (>= 1.2, < 2)
redis-store (1.9.1)
redis (>= 4, < 5)
reline (0.3.1)
io-console (~> 0.5)
serverengine (2.1.1)
sigdump (~> 0.2.2)
set (1.0.2)
sigdump (0.2.4)
sneakers (2.12.0)
bunny (~> 2.14)
concurrent-ruby (~> 1.0)
rake (~> 12.3)
serverengine (~> 2.1.0)
thor
sorted_set (1.0.3)
rbtree
set (~> 1.0)
strscan (3.0.1)
thor (1.2.1)
timeout (0.2.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.5.4)
PLATFORMS
arm64-darwin-21
DEPENDENCIES
bootsnap
bunny
debug
puma (~> 5.0)
rails (~> 7.0.2, >= 7.0.2.3)
redis
redis-namespace
redis-rack-cache
redis-rails
sneakers
tzinfo-data
RUBY VERSION
ruby 3.0.0p0
BUNDLED WITH
2.2.3
Note that I am working on a M1 Macbook Machine
I am still new to Ruby so it might be a stupid issue that's causing all this hassle
Looks like this is indeed caused by the fact that you are on an ARM platform (Mac M1 being ARM processors).
This is also somehow shown by that path in your error message:
/usr/local/bundle/gems/nokogiri-1.13.3-aarch64-linux/lib/nokogiri/3.0/nokogiri.so
aarch64 being another name of the ARM 64 bits architecture.
In order to overcome this, you will have to use the same trick you used for your MySQL container: swap it to a linux/x86_64 platform.
So, in your docker-compose.yml, you should have:
## the file above this stays the same
app:
platform: linux/x86_64
## the file below this stays the same
And adapt your Gemfile.lock, the line
nokogiri (1.13.3-arm64-darwin)
Should become
nokogiri (1.13.3-x86_64-linux)
Then, at least rebuild that container:
docker compose down
docker compose up --build
I'm relatively new to Elastic Beanstalk thus was hoping for some advice. After deploying the RoR app into EB - Puma with Ruby 2.6 running on 64bit Amazon Linux, When I 'Go to environment' link it doesn't render my app. and the health status despite being deployed successfully via CLI change to Degraded with the message below:
50.0 % of the requests to the ELB are failing with HTTP 5xx. Insufficient request rate (1.0 requests/min) to determine application health (5 minutes ago)
After checking my logs I was able to locate Gem::LoadError
/opt/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0/bundler/runtime.rb:312:in `check_for_activated_spec!': You have already activated rack 1.6.8, but your Gemfile requires rack 2.2.3. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
Here's my Gemfile:
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.6.6'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.2'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4'
# Use Puma as the app server
gem 'puma', '~> 4.1', groups: [:development, :test]
# 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 'font-awesome-sass'
#Devise Gem
gem 'devise'
#Pundit Gem
gem 'pundit'
gem "chartkick"
#Install figaro to manage local environment variables. Read more https://github.com/laserlemon/figaro
gem 'figaro'
#Install uickbooks ruby gem. Read more https://github.com/ruckus/quickbooks-ruby
gem 'quickbooks-ruby'
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]
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.2'
# 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'
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
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'prawn'
gem 'wicked_pdf'
gem 'wkhtmltopdf-binary'
gem 'xero-ruby'
gem 'sassc', '~> 2.1.0'
My Gemfile.lock looks like this:
GEM
remote: https://rubygems.org/
specs:
actioncable (6.0.3.5)
actionpack (= 6.0.3.5)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.3.5)
actionpack (= 6.0.3.5)
activejob (= 6.0.3.5)
activerecord (= 6.0.3.5)
activestorage (= 6.0.3.5)
activesupport (= 6.0.3.5)
mail (>= 2.7.1)
actionmailer (6.0.3.5)
actionpack (= 6.0.3.5)
actionview (= 6.0.3.5)
activejob (= 6.0.3.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.3.5)
actionview (= 6.0.3.5)
activesupport (= 6.0.3.5)
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.3.5)
actionpack (= 6.0.3.5)
activerecord (= 6.0.3.5)
activestorage (= 6.0.3.5)
activesupport (= 6.0.3.5)
nokogiri (>= 1.8.5)
actionview (6.0.3.5)
activesupport (= 6.0.3.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.3.5)
activesupport (= 6.0.3.5)
globalid (>= 0.3.6)
activemodel (6.0.3.5)
activesupport (= 6.0.3.5)
activerecord (6.0.3.5)
activemodel (= 6.0.3.5)
activesupport (= 6.0.3.5)
activestorage (6.0.3.5)
actionpack (= 6.0.3.5)
activejob (= 6.0.3.5)
activerecord (= 6.0.3.5)
marcel (~> 0.3.1)
activesupport (6.0.3.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
bcrypt (3.1.16)
bindex (0.8.1)
bootsnap (1.7.2)
msgpack (~> 1.0)
builder (3.2.4)
byebug (11.1.3)
capybara (3.35.3)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
chartkick (3.4.2)
childprocess (3.0.0)
concurrent-ruby (1.1.8)
crass (1.0.6)
devise (4.7.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
erubi (1.10.0)
faraday (1.3.0)
faraday-net_http (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
faraday-net_http (1.0.1)
ffi (1.15.0)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
font-awesome-sass (5.15.1)
sassc (>= 1.11)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.8.9)
concurrent-ruby (~> 1.0)
jbuilder (2.11.2)
activesupport (>= 5.0.0)
json (2.5.1)
jwt (2.2.2)
listen (3.4.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.9.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.5)
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.4)
msgpack (1.4.2)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.1.1)
mysql2 (0.5.3)
nio4r (2.5.7)
nokogiri (1.11.1)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
oauth2 (1.4.4)
faraday (>= 0.8, < 2.0)
jwt (>= 1.0, < 3.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
orm_adapter (0.5.0)
pdf-core (0.9.0)
prawn (2.4.0)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
public_suffix (4.0.6)
puma (4.3.7)
nio4r (~> 2.0)
pundit (2.1.0)
activesupport (>= 3.0.0)
quickbooks-ruby (1.0.15)
activemodel (> 4.0)
multipart-post
nokogiri
oauth2 (~> 1.4)
roxml (~> 4.0)
racc (1.5.2)
rack (2.2.3)
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3.5)
actioncable (= 6.0.3.5)
actionmailbox (= 6.0.3.5)
actionmailer (= 6.0.3.5)
actionpack (= 6.0.3.5)
actiontext (= 6.0.3.5)
actionview (= 6.0.3.5)
activejob (= 6.0.3.5)
activemodel (= 6.0.3.5)
activerecord (= 6.0.3.5)
activestorage (= 6.0.3.5)
activesupport (= 6.0.3.5)
bundler (>= 1.3.0)
railties (= 6.0.3.5)
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)
railties (6.0.3.5)
actionpack (= 6.0.3.5)
activesupport (= 6.0.3.5)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (13.0.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.1.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
roxml (4.1.1)
activesupport (>= 4.0)
nokogiri (>= 1.3.3)
ruby2_keywords (0.0.4)
rubyzip (2.3.0)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.1.0)
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)
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
thor (1.1.0)
thread_safe (0.3.6)
tilt (2.0.10)
ttfunk (1.7.0)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.1.0)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (4.6.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
webpacker (4.3.0)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
wicked_pdf (2.1.0)
activesupport
wkhtmltopdf-binary (0.12.6.5)
xero-ruby (2.8.0)
faraday (~> 1.0, >= 1.0.1)
json (~> 2.1, >= 2.1.0)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.4.2)
PLATFORMS
ruby
DEPENDENCIES
bootsnap (>= 1.4.2)
byebug
capybara (>= 2.15)
chartkick
devise
figaro
font-awesome-sass
jbuilder (~> 2.7)
listen (~> 3.2)
mysql2 (>= 0.4.4)
prawn
puma (~> 4.1)
pundit
quickbooks-ruby
rails (~> 6.0.3, >= 6.0.3.2)
sass-rails (>= 6)
sassc (~> 2.1.0)
selenium-webdriver
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
tzinfo-data
web-console (>= 3.3.0)
webdrivers
webpacker (~> 4.0)
wicked_pdf
wkhtmltopdf-binary
xero-ruby
RUBY VERSION
ruby 2.6.6p146
BUNDLED WITH
2.2.13
I have also created 2 extension files
nginx_timeout.config :
"/etc/nginx/conf.d/custom_nginx.conf":
content: |
keepalive_timeout 600;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
and Packages.config :
# These are things that make sense for any Ruby application
# Install git in order to be able to bundle gems from git
packages:
yum:
git: []
patch: []
commands:
#01 && 02 needs for build native extension. See https://forums.aws.amazon.com/thread.jspa?messageID=550901򆒥
01_bundlerfix_command:
test: test ! -f /opt/elasticbeanstalk/containerfiles/.post-provisioning-complete
command: gem install rubygems-update -v '<3'
leader_only: false
02_update_rubygems:
test: test ! -f /opt/elasticbeanstalk/containerfiles/.post-provisioning-complete
command: $(which update_rubygems)
leader_only: false
# Run rake with bundle exec to be sure you get the right version
add_bundle_exec:
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
# 複数マッチ対応と上書き防止(後読み)
command: perl -pi -e 's/((?<!bundle exec )rake)/bundle exec $1/g' 11_asset_compilation.sh 12_db_migration.sh
# Bundle with --deployment as recommended by bundler docs
# cf. http://gembundler.com/v1.2/rationale.html under Deploying Your Application
add_deployment_flag:
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
# 複数マッチ対応と上書き防止(先読み)
command: perl -pi -e 's/(bundle install(?! --deployment))/$1 --deployment/' 10_bundle_install.sh
# Vendor gems to a persistent directory for speedy subsequent bundling
make_vendor_bundle_dir:
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
command: mkdir -p /var/app/support/vendor_bundle
# Store the location of vendored gems in a handy env var
set_vendor_bundle_var:
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
cwd: /opt/elasticbeanstalk/support
command: sed -i '12iexport EB_CONFIG_APP_VENDOR_BUNDLE=$EB_CONFIG_APP_SUPPORT/vendor_bundle' envvars
# The --deployment flag tells bundler to install gems to vendor/bundle/, so
# symlink that to the persistent directory
symlink_vendor_bundle:
test: test ! -f /opt/elasticbeanstalk/support/.post-provisioning-complete
cwd: /opt/elasticbeanstalk/hooks/appdeploy/pre
command: sed -i 's/\(^cd $EB_CONFIG_APP_ONDECK\)/\1\nln -s $EB_CONFIG_APP_VENDOR_BUNDLE .\/vendor\/bundle/' 10_bundle_install.sh
# Don't run the above commands again on this instance
# cf. http://stackoverflow.com/a/16846429/283398
z_write_post_provisioning_complete_file:
cwd: /opt/elasticbeanstalk/support
command: touch .post-provisioning-complete
Any ideas what can cause the issue?
Possibly, unless there are any other problems, locking rack to 1.6.8 in your Gemfile will solve the problem.
I'm using Elastic Beanstalk in a project myself and I often regret this choice. Every time there's a platform update, I need to lock the nio4r gem to a specific version required for that platform. Also puma. It's a hassle.
As you can see others who encounter this problem too, we're not alone ;)
E.g. https://forums.aws.amazon.com/thread.jspa?messageID=957426.
I haven't found a better solution so far but then again I haven't invested a whole lot of time trying to. Let me know if you do ;)
I am trying to deploy my app to Heroku but am getting the following error every time I push the master branch.
remote: To see why this extension failed to compile, please check the mkmf.log which can
remote: be found here:
remote:
remote: /tmp/build_d18bbff5ffdeba017c7010c0d8b12d5f/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.log
remote:
remote: extconf failed, exit code 1
remote:
remote: Gem files will remain installed in
remote: /tmp/build_d18bbff5ffdeba017c7010c0d8b12d5f/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13
remote: for inspection.
remote: Results logged to
remote: /tmp/build_d18bbff5ffdeba017c7010c0d8b12d5f/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out
remote:
remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling.
remote:
remote: In Gemfile:
remote: sqlite3
remote: !
remote: ! Failed to install gems via Bundler.
remote: ! Detected sqlite3 gem which is not supported on Heroku:
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote: ! Push rejected, failed to compile Ruby app.
SQLite3 has been removed from my gem and gem lock files and it has all been pushed to git and merged with the master branch. My database.yml has been updated to use postgresql instead of sqlite3. Any ideas what is causing this to fail?
The referenced files are listed here:
Gemfile:
source 'https://rubygems.org'
#############################################################
# Non-Default Gems Added To Project
gem 'clearance'
# Postgresql version downgraded to be compatible with ActiveRecord
gem 'pg', '~>0.18.0'
gem 'activerecord'
gem 'figaro'
gem 'omniauth-facebook'
gem 'heroku'
#############################################################
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.5)
actionpack (= 4.2.5)
actionview (= 4.2.5)
activejob (= 4.2.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.5)
actionview (= 4.2.5)
activesupport (= 4.2.5)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.5)
activesupport (= 4.2.5)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.5)
activesupport (= 4.2.5)
globalid (>= 0.3.0)
activemodel (4.2.5)
activesupport (= 4.2.5)
builder (~> 3.1)
activerecord (4.2.5)
activemodel (= 4.2.5)
activesupport (= 4.2.5)
arel (~> 6.0)
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.4)
bcrypt (3.1.11)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
builder (3.2.3)
byebug (10.0.0)
clearance (1.16.1)
bcrypt
email_validator (~> 1.4)
rails (>= 3.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.0.5)
crass (1.0.3)
debug_inspector (0.0.3)
email_validator (1.6.0)
activemodel
erubis (2.7.0)
execjs (2.7.0)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.21)
figaro (1.1.1)
thor (~> 0.14)
globalid (0.4.1)
activesupport (>= 4.2.0)
hashie (3.5.7)
i18n (0.9.4)
concurrent-ruby (~> 1.0)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
jquery-rails (4.3.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
json (1.8.6)
jwt (1.5.6)
loofah (2.2.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.0)
mini_mime (>= 0.1.1)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nokogiri (1.8.2)
mini_portile2 (~> 2.3.0)
oauth2 (1.4.0)
faraday (>= 0.8, < 0.13)
jwt (~> 1.0)
multi_json (~> 1.3)
multi_xml (~> 0.5)
rack (>= 1.2, < 3)
omniauth (1.8.1)
hashie (>= 3.4.6, < 3.6.0)
rack (>= 1.6.2, < 3)
omniauth-facebook (4.0.0)
omniauth-oauth2 (~> 1.2)
omniauth-oauth2 (1.5.0)
oauth2 (~> 1.1)
omniauth (~> 1.2)
pg (0.18.4)
rack (1.6.8)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.5)
actionmailer (= 4.2.5)
actionpack (= 4.2.5)
actionview (= 4.2.5)
activejob (= 4.2.5)
activemodel (= 4.2.5)
activerecord (= 4.2.5)
activesupport (= 4.2.5)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.5)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.9)
activesupport (>= 4.2.0, < 5.0)
nokogiri (~> 1.6)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (4.2.5)
actionpack (= 4.2.5)
activesupport (= 4.2.5)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (12.3.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rdoc (4.3.0)
sass (3.5.5)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (5.0.7)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sdoc (0.4.2)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
spring (2.0.2)
activesupport (>= 4.2)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
turbolinks (5.1.0)
turbolinks-source (~> 5.1)
turbolinks-source (5.1.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.1.6)
execjs (>= 0.3.0, < 3)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
PLATFORMS
ruby
DEPENDENCIES
activerecord
byebug
clearance
coffee-rails (~> 4.1.0)
figaro
jbuilder (~> 2.0)
jquery-rails
omniauth-facebook
pg (~> 0.18.0)
rails (= 4.2.5)
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
spring
turbolinks
uglifier (>= 1.3.0)
web-console (~> 2.0)
BUNDLED WITH
1.16.1
Database.yml
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") {5} %>
timeout: 5000
development:
adapter: postgresql
<<: *default
database: airbnb_development
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: airbnb_test
production:
<<: *default
database: airbnb_production
username: (removed)
password: (removed)
I found the issue- even though I was pushing my changes to Git, I had not pulled the master back to my computer. The file being sent when I ran git push heroku master still included the sqlite3 gem even though it was deleted out in my file and on the Github master. Once I ran git checkout master and git pull origin master, I was able to deploy to Heroku.
I just tried to revive an old Rails app of mine, created July 2016.
When bundling on my new machine with fresh installs of Ruby and Rails I got this error, because json is now included into rails, and not needed in the Gemfile anymore:
An error occurred while installing json (1.8.3), and Bundler cannot continue. Make sure that gem install json -v '1.8.3'` succeeds before bundling.
If I remove the gem from the Gemfile.lock (edit: this is probably very stupid, but there was no mention of json in the Gemfile, why i looked into the Gemfile.lock), I get Unfortunately, an unexpected error occurred, and Bundler cannot continue. on bundle install:
The git source `git://github.com/flori/json.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/capistrano/rbenv.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
Fetching git://github.com/flori/json.git
The git source `git://github.com/flori/json.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
The git source `git://github.com/capistrano/rbenv.git` uses the `git` protocol, which transmits data without encryption. Disable this warning with `bundle config git.allow_insecure true`, or switch to the `https` protocol to keep your data secure.
--- ERROR REPORT TEMPLATE -------------------------------------------------------
# Error Report
## Questions
Please fill out answers to these questions, it'll help us figure out
why things are going wrong.
- **What did you do?**
I ran the command `/home/howard/.rbenv/versions/2.4.1/bin/bundle install`
- **What did you expect to happen?**
I expected Bundler to...
- **What happened instead?**
Instead, what happened was...
- **Have you tried any solutions posted on similar issues in our issue tracker, stack overflow, or google?**
I tried...
- **Have you read our issues document, https://github.com/bundler/bundler/blob/master/doc/contributing/ISSUES.md?**
...
## Backtrace
```
ArgumentError: Invalid source: nil
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/source_list.rb:107:in `source_list_for'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/source_list.rb:56:in `get'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:746:in `block in converge_locked_specs'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/2.4.0/forwardable.rb:229:in `each'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/2.4.0/forwardable.rb:229:in `each'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:743:in `converge_locked_specs'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:228:in `resolve'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:159:in `specs'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/definition.rb:147:in `resolve_remotely!'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:226:in `resolve_if_need'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:78:in `run'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/installer.rb:24:in `install'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli/install.rb:68:in `run'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:191:in `block in install'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/settings.rb:92:in `temporary'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:190:in `install'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor.rb:369:in `dispatch'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:22:in `dispatch'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/vendor/thor/lib/thor/base.rb:444:in `start'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/cli.rb:13:in `start'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/exe/bundle:30:in `block in <top (required)>'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/lib/bundler/friendly_errors.rb:121:in `with_friendly_errors'
/home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.3/exe/bundle:22:in `<top (required)>'
/home/howard/.rbenv/versions/2.4.1/bin/bundle:22:in `load'
/home/howard/.rbenv/versions/2.4.1/bin/bundle:22:in `<main>'
```
## Environment
```
Bundler 1.15.3
Rubygems 2.6.11
Ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
GEM_HOME /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0
GEM_PATH /home/howard/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0:/home/howard/.gem/ruby/2.4.0
Git 2.7.4
Platform x86_64-linux
OpenSSL OpenSSL 1.0.2g 1 Mar 2016
```
## Bundler settings
```
without
Set for your local app (/home/howard/Downloads/telefon/code/.bundle/config): "development:test"
```
## Gemfile
### Gemfile
```ruby
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'capistrano', '~> 3.1.0'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rails', '~> 1.1.1'
gem 'json', github: 'flori/json', branch: 'v1.8'
# Add this if you're using rbenv
gem 'capistrano-rbenv', github: "capistrano/rbenv"
gem "browser"
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
# gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
```
### Gemfile.lock
```
GIT
remote: git://github.com/capistrano/rbenv.git
revision: e056efc0c361cc15b76ff961d6c5f65ed5e2c57e
specs:
capistrano-rbenv (2.0.4)
capistrano (~> 3.1)
sshkit (~> 1.3)
GEM
remote: https://rubygems.org/
specs:'
actionmailer (4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.6)
actionview (= 4.2.6)
activesupport (= 4.2.6)
rack (~> 1.6)
rack-test (~> 0.6.2)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (4.2.6)
activesupport (= 4.2.6)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
activejob (4.2.6)
activesupport (= 4.2.6)
globalid (>= 0.3.0)
activemodel (4.2.6)
activesupport (= 4.2.6)
builder (~> 3.1)
activerecord (4.2.6)
activemodel (= 4.2.6)
activesupport (= 4.2.6)
arel (~> 6.0)
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
arel (6.0.3)
binding_of_caller (0.7.2)
debug_inspector (>= 0.0.1)
browser (2.1.0)
builder (3.2.2)
byebug (9.0.5)
capistrano (3.1.0)
i18n
rake (>= 10.0.0)
sshkit (~> 1.3)
capistrano-bundler (1.1.4)
capistrano (~> 3.1)
sshkit (~> 1.2)
capistrano-rails (1.1.7)
capistrano (~> 3.1)
capistrano-bundler (~> 1.1)
coffee-rails (4.1.1)
coffee-script (>= 2.2.0)
railties (>= 4.0.0, < 5.1.x)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
concurrent-ruby (1.0.2)
debug_inspector (0.0.2)
erubis (2.7.0)
execjs (2.7.0)
globalid (0.3.6)
activesupport (>= 4.1.0)
i18n (0.7.0)
jbuilder (2.5.0)
activesupport (>= 3.0.0, < 5.1)
multi_json (~> 1.2)
jquery-rails (4.1.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
loofah (2.0.3)
nokogiri (>= 1.5.9)
mail (2.6.4)
mime-types (>= 1.16, < 4)
mime-types (3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2016.0521)
mini_portile2 (2.1.0)
minitest (5.9.0)
multi_json (1.12.1)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (3.1.1)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
pkg-config (1.1.7)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rails (4.2.6)
actionmailer (= 4.2.6)
actionpack (= 4.2.6)
actionview (= 4.2.6)
activejob (= 4.2.6)
activemodel (= 4.2.6)
activerecord (= 4.2.6)
activesupport (= 4.2.6)
bundler (>= 1.3.0, < 2.0)
railties (= 4.2.6)
sprockets-rails
rails-deprecated_sanitizer (1.0.3)
activesupport (>= 4.2.0.alpha)
rails-dom-testing (1.0.7)
activesupport (>= 4.2.0.beta, < 5.0)
nokogiri (~> 1.6.0)
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
railties (4.2.6)
actionpack (= 4.2.6)
activesupport (= 4.2.6)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (11.2.2)
rdoc (4.2.2)
json (~> 1.4)
sass (3.4.22)
sass-rails (5.0.4)
railties (>= 4.0.0, < 5.0)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sdoc (0.4.1)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
spring (1.7.1)
sprockets (3.6.0)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.0.4)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.11)
sshkit (1.11.1)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uglifier (3.0.0)
execjs (>= 0.3.0, < 3)
web-console (2.3.0)
activemodel (>= 4.0)
binding_of_caller (>= 0.7.2)
railties (>= 4.0)
sprockets-rails (>= 2.0, < 4.0)
PLATFORMS
ruby
DEPENDENCIES
browser
byebug
capistrano (~> 3.1.0)
capistrano-bundler (~> 1.1.2)
capistrano-rails (~> 1.1.1)
capistrano-rbenv!
coffee-rails (~> 4.1.0)
jbuilder (~> 2.0)
jquery-rails
rails (= 4.2.6)
sass-rails (~> 5.0)
sdoc (~> 0.4.0)
spring
sqlite3
uglifier (>= 1.3.0)
web-console (~> 2.0)
BUNDLED WITH
1.12.5
```
--- TEMPLATE END ----------------------------------------------------------------
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=Invalid+source++nil&type=Issues
If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new
Does anybody know what i could try to get out of this situation?
Thanks
If you need to remove a gem you should remove it from your Gemfile, not Gemfile.lock.
In your Gemfile: gem 'json', github: 'flori/json', branch: 'v1.8'
bundler creates Gemfile.lock for you after it resolves your dependencies during bundle install, based on whatever's in your Gemfile. Gemfile.lock also specifies gems that are not in your Gemfile but are dependencies of gems that are. Editing it manually is almost guaranteed to cause you problems and fix nothing.
But you probably don't need to remove it at all. Right now you're locked onto a version of json that bundler's having trouble resolving. You should delete Gemfile.lock and let bundler generate a brand new one.