[RubyMine] Issue with automated Rake re-run after 'bundle update' Follow
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!
Please sign in to leave a comment.
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:
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?
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.
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
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.
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!