Forum: RSpec gem generators on 1.2.6

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pat M. (Guest)
on 2008-10-08 01:57
(Received via mailing list)
In a 1.2.6 app (don't ask), I don't see the generators available to me
with the gems installed.  However the documentation makes it look like
it should work:
Generator gems are also available:
  1. gem search -r generator
  2. gem install login_generator
  3. ./script/generate login

I've confirmed that with a fresh rails (2.x) app it works fine.  Is
this supposed to work with 1.2.6?  Are there any workarounds that
people have?  Is my app just fucked atm?

Pat
Pat M. (Guest)
on 2008-10-08 01:59
(Received via mailing list)
> I've confirmed that with a fresh rails (2.x) app it works fine.  Is
> this supposed to work with 1.2.6?  Are there any workarounds that
> people have?  Is my app just fucked atm?

erm, I've also confirmed that with a fresh rails 1.2.6 app it DOESN'T
see the gem generators.  I'm pretty suspicious though because of that
documentation.

Pat
Ben M. (Guest)
on 2008-10-08 02:06
(Received via mailing list)
Pat M. wrote:
> people have?  Is my app just fucked atm?
>
> Pat
> _______________________________________________
> rspec-users mailing list
> removed_email_address@domain.invalid
> http://rubyforge.org/mailman/listinfo/rspec-users
>
Hmm.. I don't know if that was supported in 1.2.6.. I know having
generators in your home dir was.

Try this workaround:

mkdir -p ~/.rails/generators
ln -s /your_gem_path/rspec-rails-1.1.8/generators
~/.rails/generators/rspec-rails-1.1.8

HTH,

Ben
David C. (Guest)
on 2008-10-08 03:39
(Received via mailing list)
On Tue, Oct 7, 2008 at 4:58 PM, Pat M. <removed_email_address@domain.invalid> 
wrote:
>> I've confirmed that with a fresh rails (2.x) app it works fine.  Is
>> this supposed to work with 1.2.6?  Are there any workarounds that
>> people have?  Is my app just fucked atm?
>
> erm, I've also confirmed that with a fresh rails 1.2.6 app it DOESN'T
> see the gem generators.  I'm pretty suspicious though because of that
> documentation.

Hey Pat - until recently, generator plugins were only found if they
were named [something]_generator:

http://github.com/rails/rails/commit/868e6b08df4b1...

So on 1.2.6, you're kinda screwed unless you want to create a local
copy of the rspec-rails gem named rspec-rails_generator :(

Cheers,
David
Pat M. (Guest)
on 2008-10-08 04:01
(Received via mailing list)
On Tue, Oct 7, 2008 at 4:34 PM, David C. <removed_email_address@domain.invalid>
wrote:
> were named [something]_generator:
>
> http://github.com/rails/rails/commit/868e6b08df4b1...
>
> So on 1.2.6, you're kinda screwed unless you want to create a local
> copy of the rspec-rails gem named rspec-rails_generator :(

No prob, I'll just use the plugins then.  Thanks for the info.

Pat
This topic is locked and can not be replied to.