[RubyMine] Issue with automated Rake re-run after 'bundle update'

I get a strange error saying that no Rakefile was found, yet it's very obviously sitting in the Rails project's home directory:

Error:[rake --tasks] Running via Spring preloader in process 13190
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
/usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:698:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:104:in `block in load_rakefile'
/usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:103:in `load_rakefile'
/usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:82:in `block in run'
/usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.7.0/gems/rake-13.0.1/lib/rake/application.rb:80:in `run'
/home/din/RubymineProjects/A2A/bin/rake:9:in `<main>'

I tried setting some breakpoints in there but 'bundle update' appears to be strictly a "run mode" operation, not "debug mode." All the initial tasks complete successfully, but it's this "Spring preloader" process that experiences heartburn.

What additional information can I supply?

Thanks in advance!

6 comments
Comment actions Permalink

One more thing I should mention is that the Gemfile is the only modification to an empty RM Rails Application project. No other code has been added to a Gemfile extended from a manual 'rails new' command build.

Here's the entire Gemfile:

# frozen_string_literal: true

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

ruby '2.7.2'

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

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

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

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

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'listen', '~> 3.2'
gem 'web-console', '>= 3.3.0'
# 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: %i[mingw mswin x64_mingw jruby]

# graphics
gem 'gosu'
gem 'opengl-bindings', '~> 1.6.10'

# semantics
gem 'equivalent-xml'
gem 'linkeddata'
gem 'nokogiri'
gem 'spira'
0
Comment actions Permalink

Hello,

could you please specify your RubyMine version? In addition, how that Rails project has been created? Would it be possible to share the project in question?

0
Comment actions Permalink

Sure, Olga! Приветь! RM is the current one, 2020.3. Ruby is 2.7.2, Rails 6.0.3.4. Linux host is Ubuntu 18.04 LTS with all updates. The project in question was automatically generated by NEW -> Rails -> Application from RubyMine, with the sole exception of the additions to the Gemfile. Nothing else was altered. All gems had been downloaded previously when I did my manual 'rails new' project from the command line prior to switching to RubyMine, and I have verified that the gems are all accessible from the username RubyMine was invoked from.The only variables in the application creation were that I selected a previously installed PostgreSQL 13 as the primary database and React as the front-end JS UI option. There are no other changes other than telling RM the database user and password.

0
Comment actions Permalink

I should also mention that there was more to the error stack backtrace, but I didn't want to clutter your Community Forum with information you can reproduce on your own systems. As I said, the Gemfile was generated elsewhere but I have yet to add more code to the site. I'm working on infrastructure and I'm also story-boarding the entire architecture of the site. I want to see this resolved sooner rather than later so I can get into the meat of the development, because it's not going to be just a shopping cart or blog... :D

EDIT:
Whoops, I just discovered another change! My bad, I will continue to investigate. As you can see, I inserted more from the older Rakefile before Rails.application.load_tasks.

Here's a diff output between the current Rakefile and the original one, with the current one on the left in the diff:

$ diff Rakefile RakeFile.orig
6,81c6
<
< # frozen_string_literal: true
<
< require "net/http"
<
< $:.unshift __dir__
< require "tasks/release"
< require "railties/lib/rails/api/task"
<
< desc "Build gem files for all projects"
< task build: "all:build"
<
< desc "Build, install and verify the gem files in a generated Rails app."
< task verify: "all:verify"
<
< desc "Prepare the release"
< task prep_release: "all:prep_release"
<
< desc "Release all gems to rubygems and create a tag"
< task release: "all:release"
<
< desc "Run all tests by default"
< task default: %w(test test:isolated)
<
< %w(test test:isolated package gem).each do |task_name|
< desc "Run #{task_name} task for all projects"
< task task_name do
< errors = []
< FRAMEWORKS.each do |project|
< system(%(cd #{project} && #{$0} #{task_name} --trace)) || errors << project
< end
< fail("Errors in #{errors.join(', ')}") unless errors.empty?
< end
< end
<
< desc "Smoke-test all projects"
< task :smoke do
< (FRAMEWORKS - %w(activerecord)).each do |project|
< system %(cd #{project} && #{$0} test:isolated --trace)
< end
< system %(cd activerecord && #{$0} sqlite3:isolated_test --trace)
< end
<
< desc "Install gems for all projects."
< task install: "all:install"
<
< desc "Generate documentation for the Rails framework"
< if ENV["EDGE"]
< Rails::API::EdgeTask.new("rdoc")
< else
< Rails::API::StableTask.new("rdoc")
< end
<
< desc "Bump all versions to match RAILS_VERSION"
< task update_versions: "all:update_versions"
<
< # We have a webhook configured in GitHub that gets invoked after pushes.
< # This hook triggers the following tasks:
< #
< # * updates the local checkout
< # * updates Rails Contributors
< # * generates and publishes edge docs
< # * if there's a new stable tag, generates and publishes stable docs
< #
< # Everything is automated and you do NOT need to run this task normally.
< desc "Publishes docs, run this AFTER a new stable tag has been pushed"
< task :publish_docs do
< Net::HTTP.new("api.rubyonrails.org", 8080).start do |http|
< request = Net::HTTP::Post.new("/rails-master-hook")
< response = http.request(request)
< puts response.body
< end
< end
<
<
< Rails.application.load_tasks
\ No newline at end of file
---
> Rails.application.load_tasks

0
Comment actions Permalink

I reverted to your automatically generated Rakefile, in the project root directory. This did not change the situation measurably.file:///home/din/RubymineProjects/A2A.tgz  Here is the tarball. An observation: the link icon does not intuitively show that you can use a file:// link as well as a http:// link. That's probably from an upstream open-source editor you are using, but the confusion should be addressed. Actually, that doesn't even work either, but let's try this.

0
Comment actions Permalink

Grrr... this is painful. You really need a 'file attach' button on this if you want to have a tarball. I will have to go post it on my GitHub account and send you a link.

Alternatively, post an e-mail address and I'll send it immediately.

Whew... I just found a "chat icon" at the very bottom of the RM support page that I could attach a file to. Done and sent!

0

Please sign in to leave a comment.