开发者

How do you install Radiant extensions for Heroku?

I havn't really found anything that works yet. I understand that Heroku does not allow submodules/extensions, so in order to install them, one needs to do something alternative.

My example is the Radiant Mailer. Normally to install this, I performed this :

.开发者_如何学JAVA/script/extension install mailer

What would be the alternative to make this work on Heroku?

I have tried this already.

I've noticed that my problem persists because even though I rm'd and wget'd it back, git status still doesn't acknowledge that it exists there. Strange..


Alright, so this is the best way I've found. Feel free to prove me wrong :

Manually install your extensions like so :

cd /path/to/radiant/vendor/extensions
wget http://github.com/saturnflyer/radiant-help-extension/tarball/master
tar xzvf saturnflyer-radiant-help-extension-*.tar.gz
mv saturnflyer-radiant-help-extension-* help
cd /path/to/radiant
rake radiant:extensions:help:migrate
rake radiant:extensions:help:update

The special note here and what was missing from my question's referred link was this :

If you used Radiant’s built-in ./script/extension install command or Ray you can ignore this section as it only applies to manual installation.

In order to correctly load extensions, Radiant needs the extension’s directory name to match the extension’s (class) name.

The matching rule is the standard Rails camelcase <→ snakecase rule. For example, for an extension called “Foo” the extension directory name must be named “foo”. And for an extension named “FooBar”, the directory name must be “foo_bar”. If you fail to follow this convention, Radiant will fail to load the extension and the application won’t start. You’ll get an error when migrating the database like:

Could not load extension from file: some_extension.
#<NameError: uninitialized constant SomeExtension>

How to know an extension’s real name? For that look inside the extension directory for a file whose name ends in “_extension.rb”. That’s the extension’s main load file. The extension’s real name is the name before that ending. In the previous examples, that file would be called “foo_extension.rb” and “foo_bar_extension.rb” respectively.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜