I have 5 Rails 5 "canery apps’ that in the past run bundle cleanly, but
yesterday things changed.
I have two repos (rt_demo_app5, rt_first_app5) that have run bundle
cleanly
(after adding rack
master to Gemfile) and 3 that do not (hello_app5, toy_app5,
sample_app_5_0_rt) even after
adding the rack master to Gemfile.
For the ones that do not run bundle cleanly, the error message is
(before
adding rack master to Gemfile):
Bundler could not find compatible versions for gem “rack”:
In Gemfile:
rails (>= 0) ruby depends on
actionpack (= 5.0.0.alpha) ruby depends on
rack (~> 2.x) ruby
Could not find gem ‘rack (~> 2.x) ruby’, which is required by
gem ‘actionpack (= 5.0.0.alpha) ruby’, in any of the sources.
After adding “gem ‘rack’, github: '‘rack/rack’” to example repo below, I
get this when I run “bundle” command:
Bundler could not find compatible versions for gem “rack”:
In Gemfile:
rails (>= 0) ruby depends on
actionpack (= 5.0.0.alpha) ruby depends on
rack (~> 1.6) ruby
rack (>= 0) ruby
It appears that we need both rack (2.x) and rack (1.6).
TRICK: Must notice what is between the paras and add them to the
config/initializers/assets.rb file.
Example: Rails.application.config.assets.precompile += %w(*
application.js
application.css* ).
Once I added all of the things that needed to be precompile (now with
sprockets 4.0), “rake” ran cleanly.
Therefore all 3 repos that I had problems with today and now fixed.
(Question Closed)
But now I get this (even aflter added the line below to
config/initializers/assets.rb) during rake run:
ActionView::Template::Error: Asset was not declared to be precompiled
in
production.Add Rails.application.config.assets.precompile += %w( application.js ) toconfig/initializers/assets.rb and restart your
server"
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.