Haml not working with Rails - ruby-on-rails

So, I know there are multiple questions and solutions on StackOverflow about Haml not working on Rails, but those haven't helped me, that's why I try again (and try to document as precise as I can).
Today, I install Haml by doing gem install haml. This installed Haml, and I tried changing my index.html.erb to index.html.haml. I got the following error:
I googled and found some solutions on StackOverflow, mentioning I should restart my server (tried it, didn't solve it) and the second solution was: install haml-rails instead of just haml and then restart my server. That didn't work, so I uninstalled haml and haml-rails, after which I installed haml-rails again (I thought the might've been bugging eachother), but to no avail.
I then read somewhere that people didn't even have Haml in their gems-list when executing bundle show (yes, I also put the gem in my bundle list). So I tried that, and indeed, Haml doesn't show up in my list of installed gems.
So, I'm hoping someone can help me out, because I'm at a loss here. If you have any questions of if I should clarify something in more detail, please ask!

Apparently, the problem was that I ran gem install haml-rails and didn't add it in my Gemfile. That's what solved the problem. I had no idea not adding it to the Gemfile and just installing it manually, could bring up errors. (Coincidentally, Marek Lipka wrote a comment with the "solution" at the moment of writing this answer).

Related

undefined method `boolean_label_class=' for SimpleForm

Attempting to run migration for my Rails app pixel_paisan is getting an error reading; NoMethodError: undefined method `boolean_label_class=' for SimpleForm:Module. Gist for the trace at https://gist.github.com/nbarnes/9796454dc28be9792284. Source code for error-production app at https://github.com/nbarnes/pixel_paisan.
I've tried uninstalling and reinstalling simple_form, doesn't help. Update entire gemset, doesn't help. Different ruby versions via RVM, doesn't help. Plain vanilla Rails app, created in an attempt to reproduce the bug works fine. Google doesn't know about my issue.
Does anybody know anything about this? I'm rapidly running out of angles to attack it from.
Short answer: update your simple_form gem to 3.1.0+. You have simple_form (3.0.2)
Longer answer: See https://github.com/rafaelfranca/simple_form-bootstrap/issues/44 which seems to be someone who had the same issue where the answer is to upgrade to simple_form 3.1.0+ whereas your Gemfile has simple_form (3.0.2)

Security Update for Spree Finding Nil for Money:Class

This security update for spree just released, but after running some Cucumber tests, I had this recurring issue:
undefined method `assume_from_symbol' for Money:Class (ActionView::Template::Error)
I searched the project repo on GH and we don't use the method. Searched the Money repo and also no findings. Searched Spree and found this. The method appears to be undefined on my development environment.
I don't know if its Spree or the project I'm dealing with. Does anyone know how to fix this?
Update: When I run bundle exec zeus cucumber I don't get these errors...
Just had this issue, followed the advice in: https://github.com/spree/spree/issues/4517
IE: add this to your Gemfile
gem 'money', '6.0.1'
fixed my issue.
I believe this is a bug in Spree:
https://github.com/spree/spree/issues/4517
You should specify the following in your Gemfile:
gem 'money', '=6.0.1'
to work around the issue for now.
Answer provided by John worked for me. However, I also had to edit the Gemfile with TextMate (or your own text editor) to make sure the single quotes are correct, as explained in this post: Gem syntax error questions

"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.

Automatic identification of Ruby Gems no longer in use within Rails

Is it possible to automatically identify Ruby gems that are no longer in use within a Rails project?
For example if a fellow developer added gem 'nokogiri' to the Gemfile, for a piece of functionally, but the code that depended on that gem has now been removed. I am looking to port my entire project to jRuby so removing the gems that we no longer seems a very sensible starting point.
Thanks
Usually gems are used in a specific way, so for each one you will have to look for patterns manually.
For example, if I had to figure if Nokogiri is being used, I'd use git grep to find Nokogiri occurrences (I assume you use git):
git grep Nokogiri
If nothing is returned, you are probably not using it.
Another way is, if you have a test suite, is just to remove it and see if something breaks. Not foolproof, but if you have good tests it should be a pretty safe path.
On rubyforge there is a gem called gem_unused. It adds an 'unused' command to 'gem'. However, I am not able to test this as it seems to be failing on my system. (I'm new to the rails world so maybe this is an issue someone else could troubleshoot. I filed an issue on it on the maintainer's github)

Rails 2.3.8 tiny mce issue - undefined method `uses_tiny_mce'

I am facing an issue in my application with tiny mce.
All the gem version & ruby version is OK on my system, but it is giving me error
= undefined method `uses_tiny_mce'
Here i installed the tiny_mce gem. COnfigured it correctely, but still there is an issue.
Please help.
Did you include
config.gem 'tiny_mce'
in config/environment.rb?
I have used this gem in the past too, but have stopped using it. I figured it complicated the setup and deployment of my Rails apps. Since then I have just used the TinyMCE editor by itself. Since it is 100% javascript, it does not touch any Ruby code which keeps things better organized.
I was not using this as a plugin.
I have followed the steps given in the,
http://enginey.googlecode.com/svn/trunk/vendor/plugins/tiny_mce/README.rdoc
Steps :
script/plugin install git://github.com/kete/tiny_mce.git
rake tiny_mce:install
my issue got resolved.

Resources