I am new to rails and new to this mailling list, if some thing I said wrong, please forgive me and correct me I am try to make our project support emotion (emoji), after a few search, I find html-pipeline (https://github.com/jch/html-pipeline) I can install it and use it in console(rails c and without require ''html/pipeline'') but when I try to use it in my project, always fail with uninitialized constant HTML::Pipeline( I try to use it in model, application_helper ) and require ''html/pipeline'' fail too here is my question 1. where should I place this kind of code (format some content, markdown, emotion, highline syntax etc) 2. I see a cast about `Redcarpet`, it just place it in Gemfile and bundle install and then can use directly, why can ''html/pipeline'' (HTML::Pipeline) thanks in advance -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/eBf2z5qo41MJ. For more options, visit https://groups.google.com/groups/opt_out.
On Fri, Dec 21, 2012 at 10:40 PM, William Herry <william.herry.china-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 1. where should I place this kind of code (format some content, markdown, > emotion, highline syntax etc) > 2. I see a cast about `Redcarpet`, it just place it in Gemfile and bundle > install and then can use directly, why can ''html/pipeline'' (HTML::Pipeline)gem "html-pipeline", require: "html/pipeline" Don''t place it in a group, place it at the bottom of the file so that rails will Bundler.require it by default. After you do that bundle and then it *should* work if it doesn''t there needs to be an actual error (trace) sent. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
thanks for you answer, it already out of any group, and I place it at the bottom still get error, maybe problem is not in installation (rails c can work) I place this code in my comment model (app/models/comment.rb) def markdown #require "html/pipeline" filter = HTML::Pipeline::MarkdownFilter.new("Hi **world**!") return filter.call end I got NameError - uninitialized constant HTML::Pipeline: if I uncomment require line I got LoadError - cannot load such file -- html/pipeline: I know I must make some stupid mistake, but just don''t know it -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
On Dec 22, 2012, at 5:32 AM, William Herry wrote:> thanks for you answer, it already out of any group, and I place it at the bottom still get error, maybe problem is not in installation (rails c can work) I place this code in my comment model (app/models/comment.rb) > > def markdown > #require "html/pipeline" > filter = HTML::Pipeline::MarkdownFilter.new("Hi **world**!") > return filter.call > end > > I got NameError - uninitialized constant HTML::Pipeline: > if I uncomment require line I got LoadError - cannot load such file -- html/pipeline: > > I know I must make some stupid mistake, but just don''t know it > >Try moving the require line off to a file that runs once at application startup, maybe /config/application.rb. Watch your console as the application starts, and see what you see then. The error acts like the gem never loaded, so maybe requiring it that late (just before you need it) is the issue. Walter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
thanks all you help the problem is that I need to restart my rails server :p thanks, merry christmas On Mon, Dec 24, 2012 at 11:59 PM, Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org>wrote:> > On Dec 22, 2012, at 5:32 AM, William Herry wrote: > > > thanks for you answer, it already out of any group, and I place it at > the bottom still get error, maybe problem is not in installation (rails c > can work) I place this code in my comment model (app/models/comment.rb) > > > > def markdown > > #require "html/pipeline" > > filter = HTML::Pipeline::MarkdownFilter.new("Hi **world**!") > > return filter.call > > end > > > > I got NameError - uninitialized constant HTML::Pipeline: > > if I uncomment require line I got LoadError - cannot load such file -- > html/pipeline: > > > > I know I must make some stupid mistake, but just don''t know it > > > > > > Try moving the require line off to a file that runs once at application > startup, maybe /config/application.rb. Watch your console as the > application starts, and see what you see then. The error acts like the gem > never loaded, so maybe requiring it that late (just before you need it) is > the issue. > > Walter > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.