I\'m getting the following error when running any rails commands like rails s
or rails c
, it\'s also preventing my heroku app from starting (same e
These commands from the bundler FAQ did the trick:
#remove project-specific settings
rm -rf .bundle/
# remove project-specific cached gems and repos
rm -rf vendor/cache/
# remove the saved resolve of the Gemfile
rm -rf Gemfile.lock
and then rebundling with bundle install
edit: heroku deploy was also failing to start up because it starts the server with bin/rails s and my binstubs were all wonky. to fix this: BUNDLE INSTALL --BINSTUBS
, again from bundler docs
I just removed the lock using rm -rf Gemfile.lock
within my project directory's root folder, and re-ran bundle install
and everything works perfect now.
I have problems like you, subscribe my case.
config/applicataion.rb:
require_relative 'boot'
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module AppName
class Application < Rails::Application
config.load_defaults 5.2
end
end
where require_relative 'boot'
is very important, such as config/boot.rb:
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require 'bundler/setup' # Set up gems listed in the Gemfile.
has including bundler library into application.