Missing Template Error when using Haml in Rails 4 - ruby-on-rails

I have been trying to use HAML with Rails 4 for an app but I'm getting a Missing Template Error as shown here.
To get to this point, I followed the following steps:
Added the following gems to my Gemfile and bundle install
My Gemfile here
Added a pages controller Check image
Updated application.html.erb to application.html.haml along with contents Check image
Added home.html.haml in pages view with code:
%h1 home page
I'm not sure why it's not working. Having googled it, I found that gem 'haml-rails' needs to be added, which I did. Yet, I'm unable to see any change.
The tutorial I'm following is here
Please help. Thank you.

I restarted the server and it seems to be working fine. Thank you all.

Related

Issue adding Bootstrap on Ruby on Rails Project

This is what I followed in order to get started with bootstrap on Ruby on Rails.
I followed every step exactly the same. However, I keep running into the same error for some reason. When I do not do any thing (i.e. do not use bootstrap) everything works (but the application looks trashy).
Whenever I use bootstrap, I get:
invalid regexp character
This is the application trace:
(execjs):24299
app/views/layouts/application.html.erb:8:in `_app_views_layouts_application_html_erb__337612969_59863020'
I have no clue what is happening.
P.S. I am a beginner. So if the solution is simple then, yeah...
remove #gem 'duktape' from gem file..the issue will be solved

pdf.js gem producing errors

I am a rails novice and trying to create my web portfolio in Cloud9. I wanted to display my resume.pdf in the user browser so I installed this gem gem 'pdfjs_rails' now my app doesn't even start in cloud 9. It show the following error messages in the terminal:
Please help me. How can i revert it back? thanks
Doesn't look like anything related to pdfjs (no point in that direction). Are you sure you've selected the right runner in Cloud9? See:
https://community.c9.io/t/error-when-running-ruby-project/11799/4
More in general: if you think an issue would be related to a gem, you can simply remove it from the Gemfile and run gem bundle to 'revert' to a previous state.

Bootsy rails gem not showing any content

I'm trying to make the bootsy gem work with Rails 4.
Followed the requirements without installing imageMagick. I just need the editor to show but nothing is working yet.
I also got this inspecting my browser since the bootsy tags work on the form but don't show anything.
Uncaught TypeError: Cannot read property 'locale' of undefined
Can anyone help? Thanks!
The gem's documentation clearly states in requirements:
https://github.com/volmer/bootsy
ImageMagick or GraphicsMagick (for MiniMagick)
Rails 4
Bootstrap 3 fully installed in your app.
Make sure you've installed these correctly. Other than that, without seeing any of your code, we can only guess at solutions. Please post code if you can.

Controller not recognizing installed Gem

Okay, I know this is a bit of a simple question, but I can't seem to get it to work. I have installed the SmarterCSV gem in my Rails 4 app and am trying to use it in my controller like so:
SmarterCSV.process("/files/csv_file.csv")
I can do this exact process in the rails console for this app, but I cannot seem to get it to work in my controller. Every time I just get the Rails Dead Screen saying uninitialized constant MyController::SmarterCSV. I have tried adding the line
require 'smarter_csv'
But that also breaks to the Rails Dead Screen with the error cannot load such file -- smarter_csv
Any help would be greatly appreciated, Im not entirely sure what I can do...
you can try require 'smarter_csv/smarter_csv' as this is the path of the file in the gem https://github.com/tilo/smarter_csv/blob/master/lib/smarter_csv/smarter_csv.rb
Don't forget to restart your application after bundle install

"Did not recognize your adapter specification" turbolinks-related error in Rails 4

I was following the Getting Started part of the Rails Guides and created the welcome controller as per the tutorial. I started the server and opened http://localhost:3000/ and instead of the <h1>Hello, Rails!</h1> it was supposed to see, I got the error Did not recognize your adapter specification.
The error block was just some HTML from the application.html.erb file, this was the offending line:
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
If I remove this line from the file, it works as expected. I googled the error and it I saw it could have something to do with the json or coffeescript gems. I have those gems installed and up to date, along with the rails and turbolinks gems, and as far I can tell they all seem to be working fine.
This is not essential, but I'd like to have turbolinks working in my Rails apps. It also feels bad to be clueless about what is wrong. How can I solve this?
I just ran into this problem again and googling again I found this question, with a similar problem.
I downgraded the multi_json gem to version 1.7.8 in the bundler, as mentioned there, and I stopped getting the error. I have yet to see if it will work in Heroku, but it's apparently solved the issue in development. If it doesn't, I'll update this answer.
This is a github issue here: https://github.com/intridea/multi_json/issues/132 which was closed four months ago, reading the comments I found that one of the files had been named .css rather than .scss in the rails project. Maybe the same error is happening with your project. I had the same exact issue and downgrading my gem worked.

Resources