# Extension problems: create model and rake db:migrate

**URL:** <https://www.ruby-forum.com/t/extension-problems-create-model-and-rake-db-migrate/90879>\
**Category:** Radiant CMS\
**Created:** [April 2, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/extension-problems-create-model-and-rake-db-migrate/90879 "2007-04-02T18:37:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spliffer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@spliffer](https://www.ruby-forum.com/u/spliffer)\
**Post date:** [April 2, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/extension-problems-create-model-and-rake-db-migrate/90879/1 "2007-04-02T18:37:52Z")

</div>

Hi everybody,  
I’m trying to develop my first radiant extension, and I’ve found two  
problems.  
I’ll try to describe this problems.

First problem:  
After that I’ve created my extension running “ruby script/generate  
extension xbrlink”, I’ve tried to create a model running “ruby  
script/generate model link” and I’ve got back this message in the  
console:

```
D:\ProveRails\xbrail>ruby script/generate model link
Couldn't find 'model' generator

I've solved this problem adding in the folder 

```

D:\ProveRails\xbrail\script a file called “generate\_model” that contains  
this script:

```
#!/usr/bin/env ruby
require File.dirname( __FILE__ ) + '/../config/boot'

```

require ‘commands/generate’

```
Now typing the command "ruby script/generate extension...", ruby 

```

creates the extension correctly, and if I type “ruby  
script/generate\_model model / controler…” ruby creates models or  
controllers correctly.  
Is this a good solution or it might causes some other problems?

Second problem:  
After that I’ve created the model called “link”, I’ve edited the  
migration file 001\_create\_links.rb, to create the links table in my  
database.  
When I run the “rake db:migrate” command in the root folder nothing  
happens, there isn’t the table in the database and I don’t have any  
error message in the console. The same thing happens if I run the  
command in the extensions folder.  
This is the console output:  
D:\prove\_rails\xbrail\>rake db:migrate

```
(in D:/prove_rails/xbrail)

   D:\prove_rails\xbrail>

```

Any suggestions?

Thaks everybody.

Taddei Fabrizio

* * *

L’email della prossima generazione? Puoi averla con la nuova Yahoo!  
Mail:

> **[Yahoo Search - Ricerca nel Web | Motore di Ricerca](https://it.search.yahoo.com/?fr2=p:fprd,mkt:it)**
>
> Il motore di ricerca ti aiuta a trovare esattamente ciò che stai cercando. Trova informazioni, video, immagini e risposte pertinenti in tutto il Web.

---

<div class="post-metadata">

**Author:** ![spliffer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@spliffer](https://www.ruby-forum.com/u/spliffer)\
**Post date:** [April 3, 2007, 5:31pm UTC](https://www.ruby-forum.com/t/extension-problems-create-model-and-rake-db-migrate/90879/2 "2007-04-03T17:31:33Z")

</div>

First problem:

There are currently no generators for extension  
models/controllers/migrations/etc. You will have to make them manually,  
although even that doesn’t take too much work.

That said, it sounds like either 1) you have installed Radiant from the  
gem without unpacking or 2) something else is messed up with the  
paths/configuration/etc.

Second problem:  
If your migration is properly in the db/migrate directory of your  
extension, then run `rake db:migrate:extensions`. That should do it.

Sean

---

<div class="post-metadata">

**Author:** ![spliffer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@spliffer](https://www.ruby-forum.com/u/spliffer)\
**Post date:** [April 3, 2007, 5:49pm UTC](https://www.ruby-forum.com/t/extension-problems-create-model-and-rake-db-migrate/90879/3 "2007-04-03T17:49:36Z")

</div>

On Apr 3, 2007, at 11:30 AM, Sean C. wrote:

> That said, it sounds like either 1) you have installed Radiant from  
> the gem without unpacking or 2) something else is messed up with the  
> paths/configuration/etc.

I have had extreme problems getting this to work. I installed 0.6 as a  
gem, and when I ran unpack, I got an endless supply of permissions  
errors when trying to run the resulting unpacked radiant. I discovered  
svn, and found it to be easier (hah!).

Could someone please advise me (slowly, in words that suit an extreme  
ruby-nuby) how to best do the following:

Install Radiant 0.6 as a Gem.  
Create a Radiant instance site.  
Modify _that site only_ with new/modified/different Extensions.

My goal here is to understand how you could use the Gem version and  
extend it on a site-by-site basis without digging into the code in the  
gems directory. Is that possible?

I have a fundamental lack of knowledge about Gems proper, and that’s  
probably where my education needs to start. Could anyone point me to a  
place where I can learn?

Thanks,

Walter

---

<div class="post-metadata">

**Author:** ![spliffer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@spliffer](https://www.ruby-forum.com/u/spliffer)\
**Post date:** [April 4, 2007, 2:12pm UTC](https://www.ruby-forum.com/t/extension-problems-create-model-and-rake-db-migrate/90879/4 "2007-04-04T14:12:31Z")

</div>

Fabrizio T. wrote:

> Sean C. wrote:
> 
> > First problem:
> > 
> > There are currently no generators for extension  
> > models/controllers/migrations/etc. You will have to make them manually,  
> > although even that doesn’t take too much work.
> > 
> > That said, it sounds like either 1) you have installed Radiant from the  
> > gem without unpacking or 2) something else is messed up with the  
> > paths/configuration/etc.
> 
> Thanks Sean for the answer,  
> this is true, I’ve installed radiant without unpacking, following the  
> radiantcms weblog instruction. I’m sorry but I’ve some problems to  
> understand what you mean.
> 
> Should I unpack radiant in the vendor folder of my application?  
> Could you explain me better what I should do?
> 
> Thanks,
> 
> Fabrizio

Hi,  
looking in mailing list I’ve found the post Radiant 0.6  
RC1([Radiant 0.6 RC1 - Radiant CMS - Ruby-Forum](http://www.ruby-forum.com/topic/96515#200885)) inwich it’s explain  
how to install radiant with unpacking.  
I’ve followed the instructions and now I’ve radiant in  
D:\ProveRails\xbrail\vendor\radiant  
I’ve modified the my application file environment.rd adding the string

ENV[‘RADIANT\_ROOT’] =‘D:\ProveRails\xbrail\vendor\radiant’ in the top of  
file,

and uncommenting the line  
ENV[‘RAILS\_ENV’] ||= ‘production’.

Unfortunately when I try to run “ruby script/generate model” I’m still  
having  
Couldn’t find ‘model’ generator

Any suggestions?

Thanks

Fabrizio

---

<div class="post-metadata">

**Author:** ![spliffer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ab097/32.png) [@spliffer](https://www.ruby-forum.com/u/spliffer)\
**Post date:** [April 4, 2007, 10:07am UTC](https://www.ruby-forum.com/t/extension-problems-create-model-and-rake-db-migrate/90879/5 "2007-04-04T10:07:58Z")

</div>

Sean C. wrote:

> First problem:
> 
> There are currently no generators for extension  
> models/controllers/migrations/etc. You will have to make them manually,  
> although even that doesn’t take too much work.
> 
> That said, it sounds like either 1) you have installed Radiant from the  
> gem without unpacking or 2) something else is messed up with the  
> paths/configuration/etc.

Thanks Sean for the answer,  
this is true, I’ve installed radiant without unpacking, following the  
radiantcms weblog instruction. I’m sorry but I’ve some problems to  
understand what you mean.

Should I unpack radiant in the vendor folder of my application?  
Could you explain me better what I should do?

Thanks,

Fabrizio
