Insoshi on Heroku

27 views
Skip to first unread message

Tom Scott

unread,
Aug 3, 2010, 11:26:52 AM8/3/10
to Insoshi
Has anyone tried deploying Insoshi on Heroku? I've been trying for
about a week now!

I've been having problems specifically with this line of code in
"config/environment.rb":
secret = ActiveSupport::SecureRandom.hex(64)

Heroku's server throws a NameError (uninitialized constant) when it
gets to this line. Although my code is slightly modified from the
insoshi github repo, I have not touched environment.rb at all, and
definitely not this bit of code here.

You can view the app error at http://illup.heroku.com/






dovadi

unread,
Aug 3, 2010, 3:02:31 PM8/3/10
to Insoshi
Hi Tom,

I see a different error: see http://skitch.com/dovadi/dxmwn/app-failed-to-start.

Heroku has a read only file system. If you don't have a file named
'secret' in your root directory, it tries to create a file and write a
secret key to it. See http://skitch.com/dovadi/dxmi8/config-environment.rb-at-master-from-insoshi-s-insoshi-github.

The solution is add a file in your root directory with the name
'secret' and add a string from at least 30 and all random characters.
You can use 'rake secret' in the console to generate such a string.
(or you can replace the secret variable in environment.rb with this
string)

Normally you wouldn't add this file (or secret string) to your
repository, but if it is a private repo and you want to use Heroku you
can choose do this and deploy the new version and it should work.

See also http://guides.rubyonrails.org/security.html#session-storage

Frank

HeresTomWithTheWeather

unread,
Aug 3, 2010, 5:04:14 PM8/3/10
to Insoshi
i'll be glad to help out as i worked with some others on this on a
fork of insoshi called oscurrency. the first half of the work was
done by lee azzarello (lazzarello) and shown off in this screencast:
http://www.opensourcecurrency.org/2010/01/oscurrency-heroku-deployment.html

the second half was done by mike travers (mtravers) and shown off in
this screencast: http://www.opensourcecurrency.org/2010/04/easy-heroku-install-and-cheepnis.html

this second screencast includes instructions for a quick heroku
install. after we got heroku compatibility working, i swapped out the
authentication to use authlogic (with openid). the insoshi fork
(forked in october 2008 before the ui inhancements but has the groups
feature merged in) i'm maintaining is here:

http://github.com/austintimeexchange/oscurrency

maybe we could create a #insoshi irc channel on freenode to
collaborate? fyi, we did a talk called "Using Insoshi to support
Community Currencies" at lonestar ruby conference last year. if any
of y'all will be at LSRC at the end of the month, it would be fun to
work with others on insoshi there.

cheers,
tom

On Aug 3, 2:02 pm, dovadi <frank.oxe...@gmail.com> wrote:
> Hi Tom,
>
> I see a different error: seehttp://skitch.com/dovadi/dxmwn/app-failed-to-start.
>
> Heroku has a read only file system. If you don't have a file named
> 'secret' in your root directory, it tries to create a file and write a
> secret key to it. Seehttp://skitch.com/dovadi/dxmi8/config-environment.rb-at-master-from-i....
>
> The solution is add a file in your root directory with the name
> 'secret' and add a string from at least 30 and all random characters.
> You can use 'rake secret' in the console to generate such a string.
> (or you can replace the secret variable in environment.rb with this
> string)
>
> Normally you wouldn't add this file (or secret string) to your
> repository, but if it is a private repo and you want to use Heroku you
> can choose do this and deploy the new version and it should work.
>
> See alsohttp://guides.rubyonrails.org/security.html#session-storage

HeresTomWithTheWeather

unread,
Aug 4, 2010, 12:05:40 AM8/4/10
to Insoshi
fyi, regarding your original question, i left a comment on the checkin
that introduced SecureRandom.hex:

http://github.com/insoshi/insoshi/commit/26bbafcc839bba86ddb5b5b03c5179f93a0c3e21#comments

after reviewing my comment, my recollection is that it seems
ActiveSupport is not available inside Rails::Initializer.run?

cheers,
tom

On Aug 3, 4:04 pm, HeresTomWithTheWeather
<herestomwiththeweat...@gmail.com> wrote:
> i'll be glad to help out as i worked with some others on this on a
> fork of insoshi called oscurrency.  the first half of the work was
> done by lee azzarello (lazzarello) and shown off in this screencast:http://www.opensourcecurrency.org/2010/01/oscurrency-heroku-deploymen...
>
> the second half was done by mike travers (mtravers) and shown off in
> this screencast:http://www.opensourcecurrency.org/2010/04/easy-heroku-install-and-che...
Reply all
Reply to author
Forward
0 new messages