Hello there, The plugin friendly_id (http://github.com/norman/friendly_id) has rake tasks that you can call. I''m using this plugin as a gem. I''m trying this: rake friendly_id:make_slugs MODEL=Post and it is rising this error: Don''t know how to build task ''friendly_id:make_slugs'' So the question is: how do I call a gem''s rake task? David Sousa -- Posted via http://www.ruby-forum.com/.
Taken directly from the README.rdoc that is part of the installed package: sudo gem install friendly_id cd my_app script/generate friendly_id rake db:migrate Here''s how to see the documentation for installed gems on your system. 1) create an executable file named "gem_server.rb" that contains #!/usr/bin/env ruby require ''rubygems/server'' gem_server = Gem::Server.new Gem.dir, 8089, false puts gem_server.inspect gem_server.run 2) run: gem_server.rb & 3) browse to: localhost:8089 On Oct 4, 9:24 pm, David Sousa <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hello there, > > The plugin friendly_id (http://github.com/norman/friendly_id) has rake > tasks that you can call. > > I''m using this plugin as a gem. > > I''m trying this: rake friendly_id:make_slugs MODEL=Post > and it is rising this error: Don''t know how to build task > ''friendly_id:make_slugs'' > > So the question is: how do I call a gem''s rake task? > > David Sousa > -- > Posted viahttp://www.ruby-forum.com/.
Hi Rick, thanks for the replay, but you did not understand my problem. I''ll try to be more clear now. I''m using friendly_id as a GEM, and it is working perfectly. Because my application already has some data, I would like to generate slugs for the post that have been created already. So that is why I wanna to execute that rake task. I can see that the rake task is defined at lib/tasks/friendly_id.rake, but how do I call that rake task in my application? Any way thanks for the hint, I did not know how to browser the already installed gems'' documentation. David Sousa Rick Lloyd wrote:> Taken directly from the README.rdoc that is part of the installed > package: > > sudo gem install friendly_id > cd my_app > script/generate friendly_id > rake db:migrate >-- Posted via http://www.ruby-forum.com/.
Rick Lloyd wrote: [...]> Here''s how to see the documentation for installed gems on your system. > > 1) create an executable file named "gem_server.rb" that contains > > #!/usr/bin/env ruby > > require ''rubygems/server'' > > gem_server = Gem::Server.new Gem.dir, 8089, false > puts gem_server.inspect > gem_server.run > > 2) run: gem_server.rb & > > 3) browse to: localhost:8089Why go to all that trouble? Much simpler to just type "gem server" at a command prompt (if you do that, the default port is 8808). I don''t see any advantage in your method...am I missing something?> > > On Oct 4, 9:24�pm, David Sousa <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
I was looking into this ticket ( https://rails.lighthouseapp.com/projects/8994/tickets/59 ) and found out that this is a problem that every gem faces. If someone knows a stable solution, pleas contact me. Thanks. David Sousa -- Posted via http://www.ruby-forum.com/.