Bootstrap Gem Installation Issue - ruby-on-rails

I have added the bootstrap-sass gem and have installed the bundle. I have gone to github and think I have followed the directions correctly to finish the install for ruby on rails. It doesn't appear to be making a difference however on my local site - no font/formatting changes have been made, even after the install.
I am using a PC, https://github.com/findingtheway/pin

Change your app/views/layouts/application.html.erb to this:
<head>
<title>Pin</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
</head>
Rails uses application by default you have default which is why bootstrap is not loading.

Related

Errno::ENOENT in Devise::Sessions#new

I'm using rails 5 to create a Facebook clone as a project and I periodically get an 'Errno::ENOENT in Devise::Sessions#new' error sometimes when I start the local server. I haven't yet experienced the problem on my production server. The problem goes away once I refresh the page.
The extracted source code is below. The line that starts stylesheet_link_tag is highlighted.
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
No such file or directory # rb_file_s_rename - path/facebook/tmp/cache/assets/sprockets/v3.0/Ej/EjoE1YdPTMb8n3_nucZiHWaR9FpoOSZttfl56_miOS0.cache.47161664401480.4109.232718, path/facebook/tmp/cache/assets/sprockets/v3.0/Ej/EjoE1YdPTMb8n3_nucZiHWaR9FpoOSZttfl56_miOS0.cache)

Rails turbolinks affect my content layout

When I enabled the turbolinks in my rails app, some of the content layout been affected and not aligned properly. But if I refresh the page then the content is aligned properly.
After adding turbolinks,
remove below Two link in views/applicatios.html.erb
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
it works for me..

Ruby On Rails won't load assets from app/assets

I'm starting in de Ruby on Rails world (I'm the noobest noob), as far as I know, when I put .css and .js into the app/assets/stylesheets folder and javascripts folder, respectively, it should automatic load those files. But it just doesn't.
I've found this code line
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
But it just renders the application.css into the HTML code.
Is there some setting I'm missing?
Ruby -v: 2.2.4p230 (2015-12-16 revision 53155) [i386-mingw32]
Rails -v: 4.2.6
stylesheet and javascript folders are different asset types, so you should declare separately.
this is my application.html.erg layout.
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
Well, the problem wasn't Ruby, wasn't Rails... Wasn't even me (I think). The problem was Windows. I did exactly the same in the Mint partition and everything worked. Thanks you, guys!

Installing Bootstrap Gem

I'm currently learning ruby on rails and
trying to install bootstrap gem
but this message shows up when I do rails server.
An #import loop has been found:
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
I followed every step correctly but this shows up

Errno::ENOENT No such file or directory Rails 4

Showing "/Users/Christian/Desktop/sample_app/app/views/layouts/application.html.erb" where line #5 raised:
No such file or directory - /Users/Christian/Desktop/vendor/assets
(in /Users/Christian/Desktop/sample_app/app/assets/stylesheets/custom.css.scss)
<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 was developing on linux ubuntu and it works fine there, I copied the folder to my mac and it no longer works. custom.css.scss is in the correct location
The problem is on line number 5 :
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>`
Change sass-rails version to 4.0.3 and leave the rest as it is. Remove Gemfile.lock when necessary, and then:
$ bundle update
$ bundle install
Finally, don't forget to restart your rails server!
In your Gemfile change the sass-rails version to 4.0.3. Get rid of a version number for sprockets. Delete the Gemfile.lock. Run the bundle install again

Resources