I have recently upgraded my app from Rails 4.2.6 to Rails 5.2.3.
I followed the procedure as on Rails Guides
Now, when I try to start my development server, it starts without any error.
But when I hit the URL in the browser an error comes up which says:
Sprockets::FileNotFound in UserSessions#new
Showing /home/pranjal/source/my-app/app/views/layouts/application.html.erb where line #5 raised:
couldn't find file 'selectize.source.css'
Checked in these paths:
/home/pranjal/source/my-app/app/assets/config
/home/pranjal/source/my-app/app/assets/font-awesome
/home/pranjal/source/my-app/app/assets/fonts
/home/pranjal/source/my-app/app/assets/images
/home/pranjal/source/my-app/app/assets/javascripts
/home/pranjal/source/my-app/app/assets/stylesheets
/home/pranjal/source/my-app/vendor/assets/javascripts
/home/pranjal/source/my-app/vendor/assets/stylesheets
...
Extracted source (around line #5):
<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
Looks like issue of incompatibility between js and new version of rails try to use/upgrade selectize-rails gem and remove js and css files from repo (if exists).
Related
So I was wondering if there was a way to have a font awesome icon beside your title like this I want to use the fa fa-pencilicon. This is my code in my head:
<head>
<title><link type="fa fa-pencil" href="fa fa-pencil">Blogger</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
All what shows up in my title is:
<link type="fa fa-pencil" href="fa fa-pencil">Blogger
In my gem file, I have added gem "font-awesome-rails" and ran bundle install.
Am I doing anything wrong? Is there a way to add the pencil icon to the title? Thanks in advance!
I'm working on a simple ruby on rails application and I am getting the following error:
TypeError: Cannot read property 'process' of undefined (in/home/saasbook/Documents/projects/Bookkeeper/app/assets/stylesheets/application.css.sass)
The Extracted source is as follows:
<html>
<head>
<title>Bookkeeper</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> //Highlighted error line in extract
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
This error occurred after I added Bootstrap Sass by Using the Bootstrap Sass plugin and following this tutorial
Below the extract its stated that the error is at:
app/views/layouts/application.html.erb:5:in_app_views_layouts_application_html_erb__226809778_88444660'
My code
application.html.erb
<!DOCTYPE html>
<html>
<head>
<title>Bookkeeper</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> //Highlighted error line in extract
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>
application.css.sass
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree
*= require_self
*/
#import "bootstrap-sprockets"
#import "bootstrap"
The page shows this title in the red border on top, is this any help?
ExecJS::ProgramError in Portal#index
There seems to be an issue with version 5.0 of the autoprefixer-rails gem. Try downgrading to 4.0.2.2.
https://github.com/ai/autoprefixer-rails/issues/47
This will pop up if you are using Node instead of RubyRacer as your JS runtime.
EDIT -
This has been fixed in the latest version of autoprefixer.
bundle update autoprefixer-rails
This has been fixed in the latest release of autoprefixer. Upgrade using the following command -
bundle update autoprefixer-rails
I'm using the stylesheet_link_tag in rails 4 and the outputted html is missing type='text/css'
I can't seem to find out how to add this to the stylesheet_link_tag.
You can add type option in your stylesheet_link_tag helper:
= stylesheet_link_tag 'application', type: 'text/css'
This should be automatic in your application.html.erb
<head>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
</head>
When I try to load the sample user page from the rails tutorial, I get this error:
Showing
C:/Sites/rails_projects/sample_app/app/views/layouts/application.html.erb
where line #5 raised: Invalid CSS after ".": expected class name, was
"." (in
C:/Sites/rails_projects/sample_app/app/assets/stylesheets/custom.css.scss:113)
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" =>
true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
<%= render 'layouts/shim' %>
I can't seem to figure out what's wrong with how the code is formatted, and I don't see what "." it's referring to.
I get an error while trying to load any page:
ActionView::Template::Error (variable #fontAwesomeEotPath_iefix is undefined)
(in /app/assets/stylesheets/bootstrap_and_overrides.css.less)):
2: <html>
3: <head>
4: <title>Program</title>
5: <%= stylesheet_link_tag "application", :media => "all" %>
6: <%= javascript_include_tag "application" %>
7: <%= csrf_meta_tags %>
8: </head> app/views/layouts/application.html.erb:5:in `_app_views_layouts_application_html_erb__242882506_70513990' app/controllers/problems_controller.rb:7:in `index'
What I did before? Just run bundle update
Because of bootstrap update I will need to update bootstrap's assets:
rails g bootstrap:install -f
There are a new line in assets:
+#fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot#iefix");
This also happened to me. This is because, When you update your Bootrap gem, You should update Its js and less css. Do
rails g bootstrap:install -f
This will add a line to your app/assets/css/bootstrap_overrides.css.less file
like
#fontAwesomeEotPath_iefix: asset-path("fontawesome-webfont.eot#iefix");