Closed thattimc closed 7 years ago
Are you using rails --api
?
no, just run this
rails generate mountain_view:component header
Mhm, seems like your app is a API-only app, thus not having ActionView and other required modules for displaying views, helpers, etc. Is that the case? Can you give a bit more context on your app?
(We're working together) I've found the problem! It's gem 'draper'
The generator works after removing draper.
The error also appears when just booting the app with rails server
or rails console
.
Not sure if this is a mountain_view issue, or a draper one..
Oh, interesting... Seems like draper is doing a bit of monkey patching: https://github.com/drapergem/draper/blob/v3.0.0/lib/draper/railtie.rb#L3-L10
But I can't see how that may be affecting Mountain View's generators... which version of draper are you using?
same 3.0.0
Interesting. I can't find any relationship to it though... If you investigate more, would you mind sharing any findings? Is this OK to close?
I'll ask over at Draper :)
An update:
Test repo: https://github.com/Frexuz/mountain_view_test
ruby '2.3.1'
source 'https://rubygems.org'
gem 'rails', '5.1.0'
gem 'listen', '~> 3.0.5'
gem 'sqlite3'
gem 'puma'
gem 'mountain_view'
gem 'draper'
gem 'activeadmin'
Seems activeadmin is included in the collision.
I'll have to post at active_admin as well :P
Oh wow, thanks for reporting! I can reproduce it now with your repo (https://github.com/Frexuz/mountain_view_test)
Will investigate further this week. Please keep us posted if any news :) Thanks again!
Any findings? :D
Hi @Frexuz, @robcole just contributed a PR that should fix this: #53 Just released that in v0.12.1, can you try it?
Works! :D <3
Just following the document to run
rails generate mountain_view:component header
It show up
/Users/Tim/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/mountain_view-0.12.0/lib/mountain_view/engine.rb:34:in
block (2 levels) in <class:Engine>': undefined method
helper' for ActionController::API:Class (NoMethodError)