Closed amoslanka closed 13 years ago
Could you show the stack trace for the error you've mentioned?
Also, when you use <% titile %> no output will be produces, instead your title will be saved to display in
The error I mentioned is a routing error, and the only information available is "undefined method `set_meta_tags' for ApplicationController:Class"
As for the title tag, that actually is how I'm using it. There's just nothing output. I've placed
<% title 'Site Name' %>
in the header and
<%= title 'Page Title' %>
in the body and still, no page title is rendered.
thanks amos
First: Great plugin, thanks!
I can also confirm this error: failed to use it with bundler in a rails2 app. However I think its an error on bundler because when I installed as a rails plugin it work like a charm.
I was able to generate an actual error in Rails 3.05 with <% set_meta_tags :description => ActionView::Template::Error (undefined method `display_meta_tags' for #<#<Class:
To fix this in Rails 3, just put in the Gemfile:
gem 'meta-tags', :require => 'meta_tags'
and then:
$ bundle install
Added information about bundler to the README
@Fedelto, I did as you say, development is fine but production will show undefined display_meta_tags or undefined title method.
thanks.
Having this same problem with Rails 3.2.6, Ruby 1.9.3-p125, meta-tags 1.2.6.
undefined method `title' for #<#<Class:0x007fde87924420>:0x007fde878a7f88>
Same issue here:
undefined method `set_meta_tags' for ApplicationController:Class
ruby 1.9.3p125 rails 3.2.3 meta-tags 1.2.6
I am also seeing this issue in production, but works fine in development.
I am having the same issue as well.
My environment: ruby 2.0.0p247 rails 3.2.14 meta-tags 1.5.0
If you're using unicorn, maybe restarting unicorn after deploy can solve your require problem.
@demirhanaydin Thanks. Restarting unicorn solved the problem.
I have the same problem, undefined method `set_meta_tags' for ApplicationController:Class and Im in development enviroment. ruby '2.5.1' and 'rails', '~> 5.0.1'
I am perhaps missing something, but I can't seem to get the proper output using this plugin with rails 3. I'm including the gem using the Bundler gemfile, and the gem is properly installed after running bundle install. I also get a "true" when running require 'meta_tags' from irb.
It seems though that something is missing because the set_meta_tags method throws an error whenever I attempt to use it, and the the <% title 'Document Title' %> tag in the erb file doesn't throw an error, but doesn't output anything.
Seems like I'm missing something. Is my using bundler to manage this plugin incorrect? It seems to me that the installation instructions on the readme apply only to rails 2.
Thanks in advance