-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundler::GemNotFound when starting running rails
commands when Gemfile has changed dependencies
#677
Comments
Looked more closely at if STDOUT.tty? || ENV["BUNDLER_FORCE_TTY"]
begin
Bundler.ui.silence { Bundler.setup }
rescue Bundler::BundlerError => e
Bundler.ui.error e.message
Bundler.ui.warn e.backtrace.join("\n") if ENV["DEBUG"]
if e.is_a?(Bundler::GemNotFound)
Bundler.ui.warn "Run `bundle install` to install missing gems."
end
exit e.status_code
end
else
Bundler.ui.silence { Bundler.setup }
end I think then the difference can be explained by Knowing that an environment variable can force it, this seems to get the error I'm looking for:
|
I'm not sure what is the issue here. Is the fact that you see a backtrace instead of a formatted error? |
@rafaelfranca that's right. These are CLI tools used by developers, and would prefer to give a formatted message with directions rather than a stack trace that isn't super clear how to fix. |
@rafaelfranca awesome, thanks! |
Let's say hypothetically, I was away at a conference for a week, and get back on Monday to pull the latest changes and start work. I've found that running
rails server
, or really any subcommand (I was tryingrails db:drop
), you end up getting a stacktrace because some gems couldn't be found:bin/rails
is the generated binstub for spring:That would make sense it load spring, and try to start a server. The place it falls down is here:
spring/lib/spring/commands.rb
Lines 31 to 33 in 184ecda
Finding that, I saw that
~/.spring.rb
is loaded. I was able to add this to that file and get better error:Interestingly,
bin/spring server
shows a colorful error with the info you need:The text was updated successfully, but these errors were encountered: