Failed to build gem native extension. + rake failed, exit code 1 - ruby-on-rails

I got multiple errors when trying to install the gems in a rails application cloned from remote repo, here's a screenshot of the error knowing that I'm still junior with RoR, knowing that I tried many answers but nothing worked
elta3lab#elta3lab-Inspiron-N5110:~/raye7-api$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32`.
Fetching gem metadata from http://rubygems.org/.............
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...........................................................................
Using rake 12.3.1
Fetching concurrent-ruby 1.1.3
Your user account isn't allowed to install to the system RubyGems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to RubyGems using sudo.
Password:
Your user account isn't allowed to install to the system RubyGems.
You can cancel this installation and run:
bundle install --path vendor/bundle
to install the gems into ./vendor/bundle/, or you can enter your password
and install the bundled gems to RubyGems using sudo.
Password:
Installing concurrent-ruby 1.1.3
Using i18n 0.9.5
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Fetching activesupport 4.2.11
Installing activesupport 4.2.11
Using builder 3.2.3
Using erubis 2.7.0
Using mini_portile2 2.3.0
Fetching nokogiri 1.8.5
Installing nokogiri 1.8.5 with native extensions
Using rails-deprecated_sanitizer 1.0.3
Using rails-dom-testing 1.0.9
Fetching crass 1.0.4
Installing crass 1.0.4
Fetching loofah 2.2.3
Installing loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Fetching actionview 4.2.11
Installing actionview 4.2.11
Fetching rack 1.6.11
Installing rack 1.6.11
Using rack-test 0.6.3
Fetching actionpack 4.2.11
Installing actionpack 4.2.11
Using globalid 0.4.1
Fetching activejob 4.2.11
Installing activejob 4.2.11
Fetching mini_mime 1.0.1
Installing mini_mime 1.0.1
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching actionmailer 4.2.11
Installing actionmailer 4.2.11
Fetching activemodel 4.2.11
Installing activemodel 4.2.11
Using arel 6.0.4
Fetching activerecord 4.2.11
Installing activerecord 4.2.11
Using activerecord-import 0.20.2
Fetching public_suffix 3.0.3
Installing public_suffix 3.0.3
Using addressable 2.5.2
Using bundler 1.16.1
Using thor 0.19.4
Fetching railties 4.2.11
Installing railties 4.2.11
Using hike 1.2.3
Using multi_json 1.13.1
Using tilt 1.4.1
Fetching sprockets 2.12.5
Installing sprockets 2.12.5
Using sprockets-rails 2.3.3
Fetching rails 4.2.11
Installing rails 4.2.11
Fetching apipie-rails 0.5.14
Installing apipie-rails 0.5.14
Using ast 2.4.0
Using execjs 2.7.0
Fetching autoprefixer-rails 9.4.2
Installing autoprefixer-rails 9.4.2
Fetching aws-sigv4 1.0.3
Installing aws-sigv4 1.0.3
Fetching jmespath 1.4.0
Installing jmespath 1.4.0
Fetching aws-sdk-core 2.11.184
Installing aws-sdk-core 2.11.184
Fetching aws-sdk-resources 2.11.184
Installing aws-sdk-resources 2.11.184
Fetching aws-sdk 2.11.184
Installing aws-sdk 2.11.184
Fetching bcrypt 3.1.12
Installing bcrypt 3.1.12 with native extensions
Using bootstrap-datepicker-rails 1.7.1.1
Using sass 3.2.19
Using bootstrap-sass 3.3.5
Using momentjs-rails 2.17.1
Using bootstrap3-datetimepicker-rails 3.1.3
Using bugsnag 6.9.0
Using uniform_notifier 1.10.0
Using bullet 5.6.1
Using byebug 9.1.0
Using cancancan 1.17.0
Using xpath 2.1.0
Using capybara 2.15.4
Using capybara-email 2.5.0
Fetching mime-types-data 3.2018.0812
Installing mime-types-data 3.2018.0812
Fetching mime-types 3.2.2
Installing mime-types 3.2.2
Fetching carrierwave 1.2.3
Installing carrierwave 1.2.3
Using carrierwave-aws 1.2.0
Using carrierwave-base64 2.6.1
Using chartkick 2.2.5
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using coffee-rails 4.0.1
Using sass-rails 4.0.5
Using chosen-rails 1.5.2
Using chronic 0.10.2
Using coderay 1.1.2
Fetching connection_pool 2.2.2
Installing connection_pool 2.2.2
Using cookiejar 0.3.3
Using daemons 1.2.6
Using data_migrate 3.2.2
Using database_cleaner 1.6.2
Fetching delayed_job 4.1.5
Installing delayed_job 4.1.5
Fetching delayed_job_active_record 4.1.3
Installing delayed_job_active_record 4.1.3
Using orm_adapter 0.5.0
Using responders 2.4.0
Using warden 1.2.7
Using devise 4.3.0
Using devise_token_auth 0.1.43
Using diff-lcs 1.3
Using docile 1.1.5
Using unf_ext 0.0.7.5
Using unf 0.1.4
Fetching domain_name 0.5.20180417
Installing domain_name 0.5.20180417
Using eventmachine 1.0.9.1
Using em-socksify 0.3.2
Using http_parser.rb 0.6.0
Using em-http-request 1.1.5
Using email_check 1.0.1
Using erubi 1.7.1
Fetching factory_bot 4.11.1
Installing factory_bot 4.11.1
Fetching factory_bot_rails 4.11.1
Installing factory_bot_rails 4.11.1
Using faker 1.8.7
Using multipart-post 2.0.0
Fetching faraday 0.15.4
Installing faraday 0.15.4
Using faraday_middleware 0.12.2
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using faye-websocket 0.10.7
Using faye 1.1.2
Using faye-rails 2.0.3
Using multi_xml 0.6.0
Using httparty 0.15.7
Fetching fcm 0.0.6
Installing fcm 0.0.6
Fetching ffi 1.9.25
Installing ffi 1.9.25 with native extensions
Using file_validators 2.1.0
Fetching font-awesome-rails 4.7.0.4
Installing font-awesome-rails 4.7.0.4
Using font-awesome-sass 4.7.0
Using foreman 0.84.0
Using formatador 0.2.5
Using formtastic 3.1.5
Fetching geocoder 1.4.9
Installing geocoder 1.4.9
Fetching geokit 1.13.1
Installing geokit 1.13.1
Fetching geokit-rails 2.3.1
Installing geokit-rails 2.3.1
Using rb-fsevent 0.10.3
Using rb-inotify 0.9.10
Using ruby_dep 1.5.0
Using listen 3.1.5
Fetching lumberjack 1.0.13
Installing lumberjack 1.0.13
Using nenv 0.3.0
Using shellany 0.0.1
Using notiffany 0.1.1
Fetching method_source 0.9.2
Installing method_source 0.9.2
Using pry 0.11.3
Fetching guard 2.15.0
Installing guard 2.15.0
Using guard-compat 1.2.1
Using rspec-support 3.7.1
Using rspec-core 3.7.1
Using rspec-expectations 3.7.0
Using rspec-mocks 3.7.0
Using rspec 3.7.0
Using guard-rspec 4.7.3
Using haml 4.0.7
Using hash-deep-merge 0.1.1
Using hashie 3.5.7
Fetching highline 2.0.0
Installing highline 2.0.0
Using http-cookie 1.0.3
Using json 1.8.6
Fetching hypertrack 0.1.6
Installing hypertrack 0.1.6
Fetching parser 2.5.3.0
Installing parser 2.5.3.0
Fetching rails-i18n 4.0.9
Installing rails-i18n 4.0.9
Fetching rainbow 2.2.2
Installing rainbow 2.2.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /tmp/bundler20181204-31799-okhy3brainbow-2.2.2/gems/rainbow-2.2.2/ext
/usr/bin/ruby2.5 mkrf_conf.rb
current directory: /tmp/bundler20181204-31799-okhy3brainbow-2.2.2/gems/rainbow-2.2.2/ext
/usr/bin/ruby2.5 -rrubygems /usr/share/rubygems-integration/all/gems/rake-12.3.1/exe/rake
RUBYARCHDIR=/tmp/bundler20181204-31799-okhy3brainbow-2.2.2/extensions/x86_64-linux/2.5.0/rainbow-2.2.2
RUBYLIBDIR=/tmp/bundler20181204-31799-okhy3brainbow-2.2.2/extensions/x86_64-linux/2.5.0/rainbow-2.2.2
/usr/bin/ruby2.5: No such file or directory -- /usr/share/rubygems-integration/all/gems/rake-12.3.1/exe/rake (LoadError)
rake failed, exit code 1
Gem files will remain installed in /tmp/bundler20181204-31799-okhy3brainbow-2.2.2/gems/rainbow-2.2.2 for inspection.
Results logged to /tmp/bundler20181204-31799-okhy3brainbow-2.2.2/extensions/x86_64-linux/2.5.0/rainbow-2.2.2/gem_make.out
An error occurred while installing rainbow (2.2.2), and Bundler cannot continue.
Make sure that `gem install rainbow -v '2.2.2'` succeeds before bundling.
In Gemfile:
i18n-tasks was resolved to 0.9.28, which depends on
rainbowMake sure that `gem install rainbow -v '2.2.2'` succeeds before bundling.
In Gemfile:
i18n-tasks was resolved to 0.9.28, which depends on
rainbow
and when trying to install rainbow, either with or without sudo, I got this error
Building native extensions. This could take a while...
ERROR: Error installing rainbow:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.5.0/gems/rainbow-2.2.2/ext
/usr/bin/ruby2.5 mkrf_conf.rb
current directory: /var/lib/gems/2.5.0/gems/rainbow-2.2.2/ext
/usr/bin/ruby2.5 -rrubygems /usr/share/rubygems-integration/all/gems/rake-12.3.1/exe/rake RUBYARCHDIR=/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/rainbow-2.2.2 RUBYLIBDIR=/var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/rainbow-2.2.2
/usr/bin/ruby2.5: No such file or directory -- /usr/share/rubygems-integration/all/gems/rake-12.3.1/exe/rake (LoadError)
rake failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.5.0/gems/rainbow-2.2.2 for inspection.
Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/rainbow-2.2.2/gem_make.out

solved using
sudo gem install rake
sudo gem install rainbow -v '2.2.2'
sudo bundle install

Related

Active Admin gem ffi won't compile on MacOS

I'm trying to run bundle install on my rails 6 app, but I can't successfully compile ffi:
../rescue [manual_assignment|✚15…3] ❯❯❯ bundle install
Fetching https://github.com/rspec/rspec-core
Fetching https://github.com/rspec/rspec-expectations
Fetching https://github.com/rspec/rspec-mocks
Fetching https://github.com/rspec/rspec-rails
Fetching https://github.com/rspec/rspec-support
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.......
Using rake 13.0.1
Using concurrent-ruby 1.1.7
Using i18n 1.8.5
Using minitest 5.14.2
Using thread_safe 0.3.6
Using tzinfo 1.2.7
Using zeitwerk 2.4.0
Using activesupport 6.0.3.2
Using builder 3.2.4
Using erubi 1.9.0
Using mini_portile2 2.4.0
Using nokogiri 1.10.10
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.7.0
Using rails-html-sanitizer 1.3.0
Using actionview 6.0.3.2
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.0.3.2
Using nio4r 2.5.2
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.3
Using actioncable 6.0.3.2
Using globalid 0.4.2
Using activejob 6.0.3.2
Using activemodel 6.0.3.2
Using activerecord 6.0.3.2
Using mimemagic 0.3.5
Using marcel 0.3.3
Using activestorage 6.0.3.2
Using mini_mime 1.0.2
Using mail 2.7.1
Using actionmailbox 6.0.3.2
Using actionmailer 6.0.3.2
Using actiontext 6.0.3.2
Fetching ruby2_keywords 0.0.2
Installing ruby2_keywords 0.0.2
Fetching arbre 1.3.0
Installing arbre 1.3.0
Using formtastic 3.1.5
Using formtastic_i18n 0.6.0
Using has_scope 0.7.2
Using method_source 1.0.0
Using thor 1.0.1
Using railties 6.0.3.2
Using responders 3.0.1
Using inherited_resources 1.11.0
Using jquery-rails 4.4.0
Using kaminari-core 1.2.1
Using kaminari-actionview 1.2.1
Using kaminari-activerecord 1.2.1
Using kaminari 1.2.1
Using polyamorous 2.3.2
Using ransack 2.3.2
Fetching ffi 1.13.1
Installing ffi 1.13.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/jason/.rvm/gems/ruby-2.6.3/gems/ffi-1.13.1/ext/ffi_c
/Users/jason/.rvm/rubies/ruby-2.6.3/bin/ruby -I /Users/jason/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r
./siteconf20200906-62332-1vq6nbs.rb extconf.rb
checking for ffi_prep_closure_loc() in -lffi... yes
checking for ffi_prep_cif_var()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
creating extconf.h
creating Makefile
current directory: /Users/jason/.rvm/gems/ruby-2.6.3/gems/ffi-1.13.1/ext/ffi_c
make "DESTDIR=" clean
current directory: /Users/jason/.rvm/gems/ruby-2.6.3/gems/ffi-1.13.1/ext/ffi_c
make "DESTDIR="
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
compiling ClosurePool.c
compiling DynamicLibrary.c
compiling Function.c
Function.c:852:17: error: implicit declaration of function 'ffi_prep_closure_loc' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
ffiStatus = ffi_prep_closure_loc(code, &fnInfo->ffi_cif, callback_invoke, closure, code);
^
Function.c:852:17: note: did you mean 'ffi_prep_closure'?
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/ffi/ffi.h:269:1: note: 'ffi_prep_closure' declared here
ffi_prep_closure(
^
1 error generated.
make: *** [Function.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/jason/.rvm/gems/ruby-2.6.3/gems/ffi-1.13.1 for inspection.
Results logged to /Users/jason/.rvm/gems/ruby-2.6.3/extensions/x86_64-darwin-19/2.6.0/ffi-1.13.1/gem_make.out
An error occurred while installing ffi (1.13.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.13.1' --source 'https://rubygems.org/'` succeeds before bundling.
Not sure what the ffi gem does or why I need it, but ActiveAdmin wants it:
In Gemfile:
activeadmin was resolved to 2.8.0, which depends on
sassc-rails was resolved to 2.1.2, which depends on
sassc was resolved to 2.4.0, which depends on
ffi
Any ideas why this is breaking? Thanks to everyone for any help!
Solved by following the steps at https://stackoverflow.com/a/48312139/13217139 then re-installed the gem with gem install ffi -- --enable-system-libffi

Pushing from Codeanywhere to Heroku - Precompiling assets failed

So I am a noob to coding. I know some html/css, but that is about it. Anyways, I am following the instructions in this poorly formatted ebook on Ruby on Rails. I have set up a container project on codeanywhere. So far I have fixed all errors up to this point through searching. It seems like a lot of people are having this problem, but I have not found a solution. I am trying to push to my Heroku account. Can anyone figure out what I am doing wrong by looking at the log? So far I have added config.assets.initialize_on_precompile = false to my application.rb file because that was one of the potential fixes. Otherwise, I'm lost.
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.4.4
-----> Installing dependencies using bundler 1.15.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Fetching rake 12.3.1
Fetching concurrent-ruby 1.0.5
Fetching json 1.8.6
Installing rake 12.3.1
Installing concurrent-ruby 1.0.5
Installing json 1.8.6 with native extensions
Fetching minitest 5.11.3
Installing minitest 5.11.3
Fetching thread_safe 0.3.6
Fetching builder 3.2.3
Installing thread_safe 0.3.6
Installing builder 3.2.3
Fetching erubis 2.7.0
Installing erubis 2.7.0
Fetching rack 1.5.5
Installing rack 1.5.5
Fetching mini_mime 1.0.0
Installing mini_mime 1.0.0
Fetching arel 5.0.1.20140414130214
Using bundler 1.15.2
Fetching coffee-script-source 1.12.2
Installing arel 5.0.1.20140414130214
Installing coffee-script-source 1.12.2
Fetching execjs 2.7.0
Installing execjs 2.7.0
Fetching thor 0.20.0
Installing thor 0.20.0
Fetching diff-lcs 1.3
Fetching hike 1.2.3
Installing hike 1.2.3
Installing diff-lcs 1.3
Fetching multi_json 1.13.1
Installing multi_json 1.13.1
Fetching mini_portile2 2.3.0
Fetching pg 0.17.1
Installing mini_portile2 2.3.0
Installing pg 0.17.1 with native extensions
Fetching tilt 1.4.1
Installing tilt 1.4.1
Fetching rails_serve_static_assets 0.0.5
Installing rails_serve_static_assets 0.0.5
Fetching rails_stdout_logging 0.0.5
Installing rails_stdout_logging 0.0.5
Fetching rdoc 4.3.0
Installing rdoc 4.3.0
Fetching rspec-support 3.8.0
Installing rspec-support 3.8.0
Fetching sass 3.2.19
Installing sass 3.2.19
Fetching turbolinks-source 5.1.0
Installing turbolinks-source 5.1.0
Fetching i18n 0.9.5
Installing i18n 0.9.5
Fetching tzinfo 1.2.5
Installing tzinfo 1.2.5
Fetching rack-test 0.6.3
Installing rack-test 0.6.3
Fetching mail 2.7.0
Installing mail 2.7.0
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Fetching uglifier 4.1.17
Installing uglifier 4.1.17
Fetching nokogiri 1.8.4
Installing nokogiri 1.8.4 with native extensions
Fetching sprockets 2.12.5
Installing sprockets 2.12.5
Fetching rails_12factor 0.0.2
Installing rails_12factor 0.0.2
Fetching rspec-core 3.8.0
Installing rspec-core 3.8.0
Fetching rspec-expectations 3.8.1
Installing rspec-expectations 3.8.1
Fetching rspec-mocks 3.8.0
Installing rspec-mocks 3.8.0
Fetching turbolinks 5.1.1
Installing turbolinks 5.1.1
Fetching rspec 3.8.0
Installing rspec 3.8.0
Fetching activesupport 4.1.6
Fetching sdoc 0.4.2
Installing sdoc 0.4.2
Installing activesupport 4.1.6
Fetching actionview 4.1.6
Fetching activemodel 4.1.6
Fetching jbuilder 2.6.4
Installing activemodel 4.1.6
Installing jbuilder 2.6.4
Installing actionview 4.1.6
Fetching activerecord 4.1.6
Installing activerecord 4.1.6
Fetching actionpack 4.1.6
Installing actionpack 4.1.6
Fetching actionmailer 4.1.6
Fetching railties 4.1.6
Fetching sprockets-rails 2.3.3
Installing actionmailer 4.1.6
Installing sprockets-rails 2.3.3
Installing railties 4.1.6
Fetching jquery-rails 3.1.5
Fetching rails 4.1.6
Fetching coffee-rails 4.0.1
Installing coffee-rails 4.0.1
Fetching sass-rails 4.0.5
Installing jquery-rails 3.1.5
Installing sass-rails 4.0.5
Installing rails 4.1.6
Bundle complete! 15 Gemfile dependencies, 54 gems now installed.
Gems in the groups development and test were not installed.
Bundled gems are installed into ./vendor/bundle.
Bundle completed (22.78s)
Cleaning up the bundler cache.
-----> Installing node-v8.10.0-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
/tmp/build_08716fff5e55005d68d2f9475e33fcff/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.6/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Fixnum is deprecated
/tmp/build_08716fff5e55005d68d2f9475e33fcff/vendor/bundle/ruby/2.4.0/gems/activesupport-4.1.6/lib/active_support/core_ext/numeric/conversions.rb:121: warning: constant ::Bignum is deprecated
Segmentation fault (core dumped)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed
Type $ RAILS_ENV=production rake assets:precompile locally
Let me know if this does work?

Rails App errors after pg gem update

I updated the pg gem for my database to the 1.0.0 version and am now having issues. I am trying to revert to the previous version, but am still getting errors. Anyone else having this same issue?
Gemfile
# Use postgresql as the database for Active Record
gem 'pg', '~> 0.21.0'
Error when I run rake db:migrate
dyld: lazy symbol binding failed: Symbol not found: _rb_fd_init
Referenced from: /Users/topher/.rvm/gems/ruby-2.5.0/gems/pg-0.21.0/lib/pg_ext.bundle
Expected in: flat namespace
No error when I run rails s
When I change my Gemfile to the newest version of the pg gem I get these errors:
Gemfile
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.0.0'
Error when I run rake db:migrate
rake aborted!
Gem::LoadError: Specified 'postgresql' for database adapter,
but the gem is not loaded. Add `gem 'pg'` to your Gemfile
(and ensure its version is at the minimum required by
ActiveRecord).
Error when I run rails s
Specified 'postgresql' for database adapter, but the gem is not
loaded. Add `gem 'pg'` to your Gemfile (and ensure its version is
at the minimum required by ActiveRecord). (Gem::LoadError)
Anyone else run into this issue and have a fix?
After looking into the issue a little bit further and with something that #MartinZinovsky stated in a comment, I wondered if it wasn't an issue with the pg gem, but with another gem not being updated, specifically ActiveRecord. This is the part of the error that got me thinking as it was showing up in both errors:
ensure its version is at the minimum required by ActiveRecord
So, instead of doing bundle update pg as Martin suggested, I did bundle update for it to go through and update all gems that had available updates. When doing this, it did in fact update all of the 'action' and 'active' gems to a newer version, along with the 'activerecord' gem. This has seemed to solve the issues. Now rake db:migrate works and so does rails s. Here is the output after I ran bundle update in case someone else runs into this issue and it is not ActiveRecord only that needed to be updated. Maybe you can use this list to see what else updated on my end to track down why it isn't working for you:
After running bundle update
$ bundle update
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/.............
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.....
Using rake 12.3.0
Using concurrent-ruby 1.0.5
Using i18n 0.9.5 (was 0.9.3)
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5 (was 1.2.4)
Using activesupport 5.1.5 (was 5.1.4)
Using builder 3.2.3
Fetching erubi 1.7.1 (was 1.7.0)
Installing erubi 1.7.1 (was 1.7.0)
Using mini_portile2 2.3.0
Using nokogiri 1.8.2
Using rails-dom-testing 2.0.3
Using crass 1.0.3
Using loofah 2.2.0 (was 2.1.1)
Using rails-html-sanitizer 1.0.3
Using actionview 5.1.5 (was 5.1.4)
Using rack 2.0.4
Using rack-test 0.8.3 (was 0.8.2)
Using actionpack 5.1.5 (was 5.1.4)
Using nio4r 2.2.0
Using websocket-extensions 0.1.3
Using websocket-driver 0.6.5
Using actioncable 5.1.5 (was 5.1.4)
Using globalid 0.4.1
Using activejob 5.1.5 (was 5.1.4)
Using mini_mime 1.0.0
Using mail 2.7.0
Using actionmailer 5.1.5 (was 5.1.4)
Using activemodel 5.1.5 (was 5.1.4)
Using arel 8.0.0
Using activerecord 5.1.5 (was 5.1.4)
Using bundler 1.16.1
Using method_source 0.9.0
Using thor 0.20.0
Using railties 5.1.5 (was 5.1.4)
Using sprockets 3.7.1
Using sprockets-rails 3.2.1
Using rails 5.1.5 (was 5.1.4)
Using actionview-encoded_mail_to 1.0.9
Using public_suffix 3.0.2 (was 3.0.1)
Using addressable 2.5.2
Using execjs 2.7.0
Fetching autoprefixer-rails 8.1.0.1 (was 7.2.5)
Installing autoprefixer-rails 8.1.0.1 (was 7.2.5)
Fetching aws-partitions 1.70.0 (was 1.61.0)
Installing aws-partitions 1.70.0 (was 1.61.0)
Using aws-sigv4 1.0.2
Using jmespath 1.3.1
Fetching aws-sdk-core 3.17.0 (was 3.15.0)
Installing aws-sdk-core 3.17.0 (was 3.15.0)
Using aws-sdk-kms 1.5.0
Fetching aws-sdk-s3 1.8.2 (was 1.8.0)
Installing aws-sdk-s3 1.8.2 (was 1.8.0)
Using bcrypt 3.1.11
Using bindex 0.5.0
Using popper_js 1.12.9
Using rb-fsevent 0.10.3 (was 0.10.2)
Using ffi 1.9.23 (was 1.9.18)
Using rb-inotify 0.9.10
Using sass-listen 4.0.0
Using sass 3.5.5
Using bootstrap 4.0.0
Using bootstrap-table-rails 1.11.1.1
Using uniform_notifier 1.11.0
Fetching bullet 5.7.4 (was 5.7.2)
Installing bullet 5.7.4 (was 5.7.2)
Using byebug 10.0.0
Using xpath 3.0.0
Using capybara 2.18.0 (was 2.17.0)
Using mime-types-data 3.2016.0521
Using mime-types 3.1
Using carrierwave 1.2.2
Using carrierwave-aws 1.3.0
Fetching childprocess 0.9.0 (was 0.8.0)
Installing childprocess 0.9.0 (was 0.8.0)
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using coffee-rails 4.2.2
Using orm_adapter 0.5.0
Using responders 2.4.0
Using warden 1.2.7
Using devise 4.4.1
Using unf_ext 0.0.7.5
Using unf 0.1.4
Using domain_name 0.5.20170404
Using dotenv 2.2.1
Using dotenv-rails 2.2.1
Using font-awesome-rails 4.7.0.3
Using http-cookie 1.0.3
Using multi_json 1.13.1
Using jbuilder 2.7.0
Using jquery-rails 4.3.1
Using jquery-ui-rails 6.0.1
Using json 2.1.0
Using ruby_dep 1.5.0
Using listen 3.1.5
Using mini_magick 4.8.0
Using netrc 0.11.0
Using pg 1.0.0
Fetching puma 3.11.3 (was 3.11.2)
Installing puma 3.11.3 (was 3.11.2) with native extensions
Fetching recaptcha 4.6.6 (was 4.6.5)
Installing recaptcha 4.6.6 (was 4.6.5)
Using redcarpet 2.3.0
Using rest-client 2.0.2
Using rubyzip 1.2.1
Using tilt 2.0.8
Using sass-rails 5.0.7
Using selenium-webdriver 3.10.0 (was 3.8.0)
Using spring 2.0.2
Using spring-watcher-listen 2.0.1
Using turbolinks-source 5.1.0
Using turbolinks 5.1.0
Fetching uglifier 4.1.7 (was 4.1.5)
Installing uglifier 4.1.7 (was 4.1.5)
Using web-console 3.5.1
Bundle updated!

devise no longer working on heroku

I have recently noticed when deploying my app to heroku that the devise gem seems to be causing me some grief due to the ruby version. I have tried lowering the devise version 3.9 but this still didn't fix it
-----> Using set buildpack heroku/ruby
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using bundler 1.11.2
Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 11.1.2
Installing aasm 4.10.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using rack 1.6.4
Using mime-types-data 3.2016.0221
Using arel 6.0.3
Using execjs 2.6.0
Using bcrypt 3.1.11
Using tilt 2.0.2
Using highline 1.7.8
Using sexp_processor 4.7.0
Using safe_yaml 1.0.4
Using sass 3.4.22
Using temple 0.7.6
Using terminal-table 1.5.2
Using cancancan 1.13.1
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.1
Using dalli 2.7.6
Using orm_adapter 0.5.0
Installing geocoder 1.3.4
Using jwt 1.5.4
Using kgio 2.10.0
Using memcachier 0.0.2
Using multi_json 1.11.2
Using pg 0.18.4
Installing puma 3.4.0 with native extensions
Using bundler 1.11.2
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using rolify 5.1.0
Using tzinfo 1.2.2
Installing braintree 2.60.0
Using nokogiri 1.6.7.2
Using rack-test 0.6.3
Using warden 1.2.6
Using mime-types 3.0
Using autoprefixer-rails 6.3.6
Using uglifier 3.0.0
Using haml 4.0.7
Using ruby_parser 3.8.1
Using slim 3.0.6
Using coffee-script 2.4.1
Installing sprockets 3.6.0
Using twilio-ruby 4.11.1
Using rails_12factor 0.0.3
Using activesupport 4.2.4
Using loofah 2.0.3
Using mail 2.6.4
Using material_design_lite-sass 1.1.3
Using ruby2ruby 2.3.0
Using html2haml 2.0.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemerchant 1.58.0
Using activemodel 4.2.4
Using rails-html-sanitizer 1.0.3
Using brakeman 3.2.1
Using rails-dom-testing 1.0.7
Using activejob 4.2.4
Using activerecord 4.2.4
Using actionview 4.2.4
Using friendly_id 5.1.0
Using pg_search 1.0.5
Using actionpack 4.2.4
Using actionmailer 4.2.4
Using railties 4.2.4
Using kaminari 0.16.3
Using sprockets-rails 3.0.4
Using coffee-rails 4.1.1
Using responders 2.1.2
Using jquery-rails 4.1.1
Using rails 4.2.4
Using sass-rails 5.0.4
Installing devise 4.0.0
Gem::InstallError: devise requires Ruby version >= 2.1.0.
An error occurred while installing devise (4.0.0), and Bundler cannot continue.
Make sure that `gem install devise -v '4.0.0'` succeeds before bundling.
Bundler Output: Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Rubygems 2.0.14.1 is not threadsafe, so your gems will be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation.
Using rake 11.1.2
Installing aasm 4.10.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.8.4
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.0.0
Using rack 1.6.4
Using mime-types-data 3.2016.0221
Using arel 6.0.3
Using execjs 2.6.0
Using bcrypt 3.1.11
Using tilt 2.0.2
Using highline 1.7.8
Using sexp_processor 4.7.0
Using safe_yaml 1.0.4
Using sass 3.4.22
Using temple 0.7.6
Using terminal-table 1.5.2
Using cancancan 1.13.1
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.1
Using dalli 2.7.6
Using orm_adapter 0.5.0
Installing geocoder 1.3.4
Using jwt 1.5.4
Using kgio 2.10.0
Using memcachier 0.0.2
Using multi_json 1.11.2
Using pg 0.18.4
Installing puma 3.4.0 with native extensions
Using bundler 1.11.2
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.5
Using rolify 5.1.0
Using tzinfo 1.2.2
Installing braintree 2.60.0
Using nokogiri 1.6.7.2
Using rack-test 0.6.3
Using warden 1.2.6
Using mime-types 3.0
Using autoprefixer-rails 6.3.6
Using uglifier 3.0.0
Using haml 4.0.7
Using ruby_parser 3.8.1
Using slim 3.0.6
Using coffee-script 2.4.1
Installing sprockets 3.6.0
Using twilio-ruby 4.11.1
Using rails_12factor 0.0.3
Using activesupport 4.2.4
Using loofah 2.0.3
Using mail 2.6.4
Using material_design_lite-sass 1.1.3
Using ruby2ruby 2.3.0
Using html2haml 2.0.0
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.6
Using activemerchant 1.58.0
Using activemodel 4.2.4
Using rails-html-sanitizer 1.0.3
Using brakeman 3.2.1
Using rails-dom-testing 1.0.7
Using activejob 4.2.4
Using activerecord 4.2.4
Using actionview 4.2.4
Using friendly_id 5.1.0
Using pg_search 1.0.5
Using actionpack 4.2.4
Using actionmailer 4.2.4
Using railties 4.2.4
Using kaminari 0.16.3
Using sprockets-rails 3.0.4
Using coffee-rails 4.1.1
Using responders 2.1.2
Using jquery-rails 4.1.1
Using rails 4.2.4
Using sass-rails 5.0.4
Installing devise 4.0.0
Gem::InstallError: devise requires Ruby version >= 2.1.0.
An error occurred while installing devise (4.0.0), and Bundler cannot continue.
Make sure that `gem install devise -v '4.0.0'` succeeds before bundling.
!
! Failed to install gems via Bundler.
!
! Push rejected, failed to compile Ruby app
You can specify the ruby in your Gemfile, or better yet set an environment variable in your heroku app config: devcenter.heroku.com/articles/ruby-versions

Issue with rails server(WEBrick)

I have posted this question before but I had no luck. I am posting it again with extra information that might help solve the problem.
I am having an issue with rails server while working on cloud 9. I was installing the gem 'jquery-ui-rails' and I needed to restart my server.
My friend and I share the workspace. The servers were running on my friends laptop so I decided to go to the tmp/pids/server.pids file and run the command sudo kill -9 <PID>, <PID> was replaced by the number in the file server.pid. It killed the servers perfectly. However, I get the following error after running the command $ rails server -b $IP -p $PORT in the terminal.
kpauls#score_app:~/workspace (dev-messaging) $ rails server -b $IP -p $PORT
bin/rails:6: warning: already initialized constant APP_PATH
/home/ubuntu/workspace/bin/rails:6: warning: previous definition of APP_PATH was here
Error: Command '-b' not recognized
Usage: rails COMMAND [ARGS]
I have done this before and I have had no problems with it. I really don't understand what the problem is.
After I added the gem, I think I ran bundle update and Not bundle install. This updated all the gems in my Gemfile. I ran bundle install after. However, I don't think the bundle update cause any problems though. The app was running fine. Maybe one of the gems got updated and it interfered with the server gem.
I have included the terminal after I ran bundle update.
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.4.2
Using i18n 0.7.0
Using json 1.8.3
Installing minitest 5.8.2 (was 5.7.0)
Using thread_safe 0.3.5
Using tzinfo 1.2.2
Using activesupport 4.2.0
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile 0.6.2
Using nokogiri 1.6.6.2
Using rails-deprecated_sanitizer 1.0.3
Installing rails-dom-testing 1.0.7 (was 1.0.6)
Installing loofah 2.0.3 (was 2.0.2)
Using rails-html-sanitizer 1.0.2
Using actionview 4.2.0
Installing rack 1.6.4 (was 1.6.1)
Using rack-test 0.6.3
Using actionpack 4.2.0
Installing globalid 0.3.6 (was 0.3.5)
Using activejob 4.2.0
Installing mime-types 2.6.2 (was 2.6.1)
Using mail 2.6.3
Using actionmailer 4.2.0
Using activemodel 4.2.0
Installing arel 6.0.3 (was 6.0.0)
Using activerecord 4.2.0
Using ancestry 2.1.0
Using ansi 1.5.0
Using bcrypt 3.1.7
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.3.pre1
Installing sass 3.4.19 (was 3.4.14)
Using bootstrap-sass 3.2.0.0
Using will_paginate 3.0.7
Using bootstrap-will_paginate 0.0.10
Using bundler 1.8.4
Using columnize 0.9.0
Using debugger-linecache 1.2.0
Using slop 3.6.0
Using byebug 3.4.0
Using carrierwave 0.10.0
Using coderay 1.1.0
Installing coffee-script-source 1.10.0 (was 1.9.1.1)
Installing execjs 2.6.0 (was 2.5.2)
Using coffee-script 2.4.1
Using thor 0.19.1
Using railties 4.2.0
Using coffee-rails 4.1.0
Installing excon 0.45.4 (was 0.45.3)
Using faker 1.4.2
Installing ffi 1.9.10 (was 1.9.8)
Using formatador 0.2.5
Installing fog-core 1.33.0 (was 1.30.0)
Installing multi_json 1.11.2 (was 1.11.0)
Using fog-json 1.0.2
Using inflecto 0.0.2
Installing fog-brightbox 0.9.0 (was 0.7.1)
Installing fog-softlayer 1.0.2 (was 0.4.6)
Using ipaddress 0.8.0
Using fog 1.23.0
Using foreigner 1.7.4
Installing rb-fsevent 0.9.6 (was 0.9.5)
Using rb-inotify 0.9.5
Installing listen 3.0.4 (was 2.10.0)
Using lumberjack 1.0.9
Using nenv 0.2.0
Using shellany 0.0.1
Installing notiffany 0.0.8 (was 0.0.6)
Using method_source 0.8.2
Installing pry 0.10.3 (was 0.10.1)
Installing guard 2.13.0 (was 2.12.6)
Using guard-minitest 2.3.1
Using jbuilder 2.2.3
Using jquery-rails 4.0.3
Using jquery-ui-rails 5.0.5
Installing sprockets 3.4.0 (was 3.2.0)
Installing sprockets-rails 2.3.3 (was 2.3.1)
Using rails 4.2.0
Using mailboxer 0.13.0
Using mini_backtrace 0.1.3
Using subexec 0.2.3
Using mini_magick 3.8.0
Using ruby-progressbar 1.7.5
Using minitest-reporters 1.0.5
Using pg 0.17.1
Using puma 2.11.1
Using rails_serve_static_assets 0.0.4
Installing rails_stdout_logging 0.0.4 (was 0.0.3)
Using rails_12factor 0.0.2
Using rdoc 4.2.0
Using tilt 1.4.1
Using sass-rails 5.0.2
Using sdoc 0.4.0
Using spring 1.1.3
Using sqlite3 1.3.9
Using turbolinks 2.3.0
Using twitter-bootstrap-rails 3.2.0
Using uglifier 2.5.3
Using web-console 2.0.0.beta3
Bundle updated!
config/boot.rb file
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
Things I have tried
I had posted this question earlier and I was given a few suggestions. First suggestion was to run the command $ rake rails:update:bin. This command didn't work. Another suggestion was to look in the config/boot.rb file to see if anything was incorrect. I included that file as well. I have never made changes to that file. So it must be good.
I tried looking for answers but couldn't find anything. I am reposting this question with the bundle update code in the terminal hoping it might help solve the problem. Any kind of direction or help would be greatly appreciated. Thanks!!

Resources