# Radiant as Rails3 engine & RADIANT\_ROOT

**URL:** <https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738>\
**Category:** Radiant CMS\
**Created:** [November 27, 2010, 11:35pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738 "2010-11-27T23:35:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 27, 2010, 11:35pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/1 "2010-11-27T23:35:20Z")

</div>

I am just getting started with Radiant and am trying to use it as a  
Rails 3 engine. When I try to install an extension, I get an error  
about RAILS\_ROOT not being defined. This was easy enough to resolve  
(I added a RAILS\_ROOT constant in config/boot.rb of my app). However,  
the RADIANT\_ROOT constant is also undefined. Here is the stacktrace:

mario:(git)strangeloop[radiant\_engine]/$ script/extension install  
forms  
/Users/mario/.rvm/gems/ruby-1.8.7-p302/bundler/gems/  
radiant-1e7494558a8e/lib/radiant/extension/script.rb:286:in  
`extension_paths': uninitialized constant Radiant::Extension::Script::Util::RADIANT_ROOT (NameError) from /Users/mario/.rvm/gems/ruby-1.8.7-p302/bundler/gems/ radiant-1e7494558a8e/lib/radiant/extension/script.rb:278:in`installed?’  
from /Users/mario/.rvm/gems/ruby-1.8.7-p302/bundler/gems/  
radiant-1e7494558a8e/lib/radiant/extension/script.rb:304:in  
`initialize' from /Users/mario/.rvm/gems/ruby-1.8.7-p302/bundler/gems/ radiant-1e7494558a8e/lib/radiant/extension/script.rb:261:in`new’  
from /Users/mario/.rvm/gems/ruby-1.8.7-p302/bundler/gems/  
radiant-1e7494558a8e/lib/radiant/extension/script.rb:261:in `execute’  
from script/extension:5

Since I am trying to use Radiant as a Rails engine, what should the  
RADIANT\_ROOT be? Should I freeze the radiant gem (and put it under  
vendor/gems)?

–Mario

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [November 28, 2010, 6:16pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/2 "2010-11-28T18:16:35Z")

</div>

On Nov 27, 2010, at 5:34 PM, Mario A. wrote:

> Since I am trying to use Radiant as a Rails engine, what should the  
> RADIANT\_ROOT be? Should I freeze the radiant gem (and put it under  
> vendor/gems)?

Radiant as an engine is still under construction and I can’t recommend  
using it for anything real at the moment. The 0.9.1 gem is only  
compatible with Rails 2, but that’s the latest stable release.

For hacking on the rails3 branch, I’ve been unpacking it into  
lib/radiant and pointing Bundler there with gem “radiant”, :path =\>  
“lib/radiant”.

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [November 28, 2010, 9:34pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/3 "2010-11-28T21:34:05Z")

</div>

Another data point is that if I try to run rake from bundler, I get:

mario:(git)radiant[mario-rails3]/$ bundle exec rake -P  
(in /Users/mario/tmp/radiant/radiant)  
rake aborted!  
uninitialized constant Radiant  
/Users/mario/tmp/radiant/radiant/Rakefile:9:in `\<top (required)\>’  
(See full trace by running task with --trace)

So it gets past the require ‘dataset/tasks’, but blows up on the line  
that says:

Radiant::Application.load\_tasks

–Mario

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [November 28, 2010, 9:07pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/4 "2010-11-28T21:07:09Z")

</div>

I’d like to do what you suggest and perhaps I am going about it the  
wrong way. I thought what you were suggesting below was creating a  
local gem build of the radiant rails3 branch and then unpacking that  
in a ‘lib/radiant’ directory within the project I am working in. Is  
that what you were suggesting or something different?

I tried doing what I just described, and I got an error trying to run  
rake. Here’s what I did:

mario:(git)radiant[mario-rails3]/$ rake -P | grep gem  
rake aborted!  
no such file to load – dataset/tasks  
/Users/mario/tmp/radiant/radiant/Rakefile:7  
(See full trace by running task with --trace)

I had a look in the Rakefile and saw that on line 7, it is trying to  
require ‘dataset/tasks’. There isn’t a dataset directory with a  
tasks.rb file anywhere that could find in the project. Do I need to  
have something else in place to have the rail3 branch working? I was  
hoping that all I needed to do was: rake radiant:gem and have the  
local branch built into a gem that I could unpack in my project (per  
your suggestion), but it seems that creating a gem from the branch  
isn’t working out of the box (unless there is another way to do it).

–Mario

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [November 30, 2010, 9:49pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/5 "2010-11-30T21:49:42Z")

</div>

I think I have been bitten by this as well

I’ve tried a rake production db:bootstrap which runs ok until trying  
to recreate the admin user in which I get:

rake aborted!  
undefined method `home\_path’ for #User:0x6fe0ce3b4dd0

Doing some digging I found references to making sure there are routes  
in place, but this might be a red herring.

I have the following versions of rails installed (3.0.3, 2.3.8, 2.3.5,  
2.3.4, 2.3.3, 2.2.3, 2.2.2, 2.1.2, 2.1.1, 2.1.0, 2.0.5, 2.0.2)

Looking at the reference to gemfile (which I am going to have to read  
up on) in Joshua’s previous mail I was wondering if it would be  
possible to fix the rails version to say 2.3.8? If so what else should  
I be aware of?

I don’t think I can remove 3.0.3 as I’m not sure if it is in mine or  
from Dreamhost’s installation.

Marc

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [November 29, 2010, 6:51pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/6 "2010-11-29T18:51:47Z")

</div>

On Nov 28, 2010, at 3:05 PM, Mario A. wrote:

> I thought what you were suggesting below was creating a  
> local gem build of the radiant rails3 branch and then unpacking that  
> in a ‘lib/radiant’ directory within the project I am working in.

You don’t need to build the gem. Just clone the rails3 branch into  
lib/radiant of your current project and load Radiant from there. My  
Gemfile looks like this:

```
gem 'rails', '3.0.1'
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'radiant', :path => 'lib/radiant'
gem 'compass'

```

> Do I need to  
> have something else in place to have the rail3 branch working?

A lot of the Rails 3 branch simply doesn’t work yet. That includes the  
rake tasks. As I said before, the Rails 3 conversion has just begun and  
I guarantee you’ll continue to run into problems.

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [November 30, 2010, 10:09pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/7 "2010-11-30T22:09:10Z")

</div>

That is good to know, and now means I have to work out why I am  
getting:

undefined method `home\_path’ for #User:0x6fe0ce3b4dd0

when creating the admin user

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [November 30, 2010, 10:12pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/8 "2010-11-30T22:12:19Z")

</div>

looks like it might be coming from the member extension (or not it was  
just the first hit in google).

> **[GitHub - Aissac/radiant-member-extension: Restrict site content to registered...](https://github.com/Aissac/radiant-member-extension)**
>
> Restrict site content to registered members. Contribute to Aissac/radiant-member-extension development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [December 1, 2010, 1:14am UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/9 "2010-12-01T01:14:52Z")

</div>

I think the culprit was User Home. Disabled it and db:bootstrap  
happened, although some of the tables for extensions didn’t get  
created so the site is fragile at the moment

Almost at the point of starting over with the hope that it works out  
better than the first time

Marc

---

<div class="post-metadata">

**Author:** ![mandrade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/85e7bf/32.png) [@mandrade](https://www.ruby-forum.com/u/mandrade)\
**Post date:** [November 30, 2010, 10:03pm UTC](https://www.ruby-forum.com/t/radiant-as-rails3-engine-radiant-root/199738/10 "2010-11-30T22:03:30Z")

</div>

On Tue, Nov 30, 2010 at 2:48 PM, Marc [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I was wondering if it would be  
> possible to fix the rails version to say 2.3.8?

radiant has a frozen version of rails in the gem (and repo in case you  
don’t use the gem). so none of your rails gems matter to radiant (you  
could uninstall them all and radiant will still run).
