Sequel and Heroku

2010-09-02 Thread Scott LaBounty
All,

Since all three lists helped me quite a bit with this one, I thought I'd let
everyone know about this post ...

http://steamcode.blogspot.com/2010/09/sequel-and-heroku.html

Iif you spot any issues,let me know so I can correct them and hopefully,
this will help others who need to do this.

Thanks all,

-- 
Scott
http://steamcode.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: How to deploy app with sensitive config information?

2010-09-02 Thread dnagir
> but I wouldn't mind knowing what you mean/how you
> do:
>
> "For git I configure my app not to include any sensitive information so it
> will not appear anywhere."
For example, I add the database.yaml file to .gitignore and instead
store database.yaml.samle.

Of course if you get the code from Git for the first time you have to
rename database.yaml.sample to database.yaml and set proper
credentials.

(But for heroku deployments it is not that critical as you don't store
DB connection details in database.yaml anyway)


> > The general way to set up config values is with heroku config:add
> > NAME=VALUE  I have no idea what level of security that affords you that git
> > would not, but that's all I know of.  (I'm far far from an expert here
> > though).

Thanks a lot. It should do the job.
Related docs are here for others to save some Googling:
http://docs.heroku.com/config-vars

The heroku guys provide S3 credentials as an example (in the docs).
So I guess they realise that those are sensitive details and take
appropriate security measures.

Cheers,
Dima.
http://ApproachE.com

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: html to pdf on heroku

2010-09-02 Thread Alex Killough
many thanks, Filip; I'll give it a shot and let you know what I find!

On Wed, Sep 1, 2010 at 6:05 AM, Filip  wrote:
> Hello Alex,
> i have recently ran into same problem with wkhtmltopdf,
> on my fairly complex view it timed out, while on simple (i.e CRUD
> views) it worked fine.
> I assume you are using pdfkit gem's middleware to simply generate the
> files.
>
> If that is the case, turn the middleware off and configure your pdf
> print in respond_to block in your controller's action
> This worked for me, now even the complex view generates as quickly as
> the simple views and i have complete control over which action gets a
> pdf view
>
> Hope it helps,
> Filip
>
> On 24 srp, 14:14, Alex Killough  wrote:
>> Hi all--
>>
>> I'm attempting to render a pdf of an html view in my sinatra app.
>> Locally, wkhtmltopdf works, but times-out on heroku. I'd prefer not to
>> shell over an additional $20/month and set up delayed jobs; is there
>> an alternate route anyone has had success with? PrinceXML is out due
>> to price, and I'm a bit scared off by prawn due to syntax and the git
>> submodule issue.
>>
>> Many thanks,
>> Alex
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to her...@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/heroku?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Calling all forks

2010-09-02 Thread chris
In this case, I'd use a cron job. Cache the output every hour for $5/
month (or every day for free.)

On Sep 1, 1:50 am, Gabriel  wrote:
> This seems to be a somewhat common use case for Heroku:  I have a
> process that takes far too long to tie up a web request but doesn't
> happen often enough to warrant paying for a Worker.
>
> Right now I'm considering calling fork to handle this situation and I
> have two questions:
>
> 1.  Will this work on Heroku?  That is: are there any specifics about
> the Heroku architecture that would prevent forks?
>
> 2.  Is there a better way that doesn't involve having a Worker running
> all the time?  I've seen people mention that Workers can be spun up
> and deleted programmatically but I've yet to see what the API for
> doing so looks like.
>
> Thanks,
>
> Gabriel

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: How to deploy app with sensitive config information?

2010-09-02 Thread Hemal Kuntawala
Not sure on the resolution but I wouldn't mind knowing what you mean/how you
do:

"For git I configure my app not to include any sensitive information so it
will not appear anywhere."

Ta.

On 2 September 2010 18:51, Jeff Deville  wrote:

> The general way to set up config values is with heroku config:add
> NAME=VALUE  I have no idea what level of security that affords you that git
> would not, but that's all I know of.  (I'm far far from an expert here
> though).
>
>
> On Sep 1, 2010, at 10:38 AM, dnagir wrote:
>
> > Hi,
> >
> > Deployment to Heroku is done as a Git push.
> > For git I configure my app not to include any sensitive information so
> > it will not appear anywhere.
> > This includes email, payment gateway credentials, encryption key, etc.
> >
> > So how would I deploy that information together with the application
> > without storing it in git?
> >
> > Cheers,
> > Dmytrii.
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> > To post to this group, send email to her...@googlegroups.com.
> > To unsubscribe from this group, send email to
> heroku+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> To post to this group, send email to her...@googlegroups.com.
> To unsubscribe from this group, send email to
> heroku+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



git push heroku master CONNECTION REFUSED

2010-09-02 Thread @demetriusolsen
Two-hours later, the simplest command isn't working for me: git push
heroku master
Here's what I get in response:
ssh: connect to host heroku.com port 22: Connection refused
fatal: The remote end hung up unexpectedly

I've followed Heroku's documentation (Created a new SSH key, double-
checked to make sure my public key matches with what Heroku has, gem
uninstalled heroku and reinstalled it). Does anyone have a
suggestion?

The ONE that that I know I did differently was not use sudo when
installing heroku. I'm letting RVM manage my gems... could that be it?

What's strange about this is that I was able to use git push heroku
master a few weeks ago when I was trying to decide if I should use
Heroku to deploy my app. It worked then

Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: How to deploy app with sensitive config information?

2010-09-02 Thread Jeff Deville
The general way to set up config values is with heroku config:add NAME=VALUE  I 
have no idea what level of security that affords you that git would not, but 
that's all I know of.  (I'm far far from an expert here though). 


On Sep 1, 2010, at 10:38 AM, dnagir wrote:

> Hi,
> 
> Deployment to Heroku is done as a Git push.
> For git I configure my app not to include any sensitive information so
> it will not appear anywhere.
> This includes email, payment gateway credentials, encryption key, etc.
> 
> So how would I deploy that information together with the application
> without storing it in git?
> 
> Cheers,
> Dmytrii.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Heroku" group.
> To post to this group, send email to her...@googlegroups.com.
> To unsubscribe from this group, send email to 
> heroku+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/heroku?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Calling all forks

2010-09-02 Thread Gabriel
This seems to be a somewhat common use case for Heroku:  I have a
process that takes far too long to tie up a web request but doesn't
happen often enough to warrant paying for a Worker.

Right now I'm considering calling fork to handle this situation and I
have two questions:

1.  Will this work on Heroku?  That is: are there any specifics about
the Heroku architecture that would prevent forks?

2.  Is there a better way that doesn't involve having a Worker running
all the time?  I've seen people mention that Workers can be spun up
and deleted programmatically but I've yet to see what the API for
doing so looks like.

Thanks,

Gabriel

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



I'm behind a proxy which blocks port 22. Will heroku ever allow pushes to port 443?

2010-09-02 Thread Ed Lebert
github added a url to allow git pushes to port 443 for those of us
behind proxies which block port 22 requests.  Could heroku do
something similar?  :)

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Time Zone best practices? UTC? Local?

2010-09-02 Thread Mike P.
Hello,

I keep seeing conflicting recommendations on dealing with time zones
on Heroku, and I'm really not sure what to do. For example:

1) This post (which I think may be from someone at Heroku) says to use
UTC:

- 
http://groups.google.com/group/heroku/browse_thread/thread/8e7566a7b8223dd2/0e79d1cc3bcdc452?lnk=gst&q=time+zone+problem#0e79d1cc3bcdc452

2) This post gives a suggestion to specify the Heroku time zone in the
application:

- 
http://stackoverflow.com/questions/2719330/heroku-time-zone-problem-logging-local-server-time

3) This post recommends specifying a TimeZone during a heroku db:pull
call

- 
http://stackoverflow.com/questions/1416294/weird-time-inconsistencies-between-production-and-development

And so on...

I'm inclined to go with number 1, but does anyone have any suggestions/
recommendations/tips or "best practices" on dealing with this time
zone issue?

Right now, my time zone is set to "Eastern Time (US & Canada)" in
environment.rb, and the date/time columns in my Postgre tables are set
to "timestamp without time zone." The users will have their own
timezone setting that will be used throughout the app.

Is there anything else I should be doing? How can I eliminate any
potential timing issues between development and running on Heroku in
production? Any thoughts or advice would be greatly appreciated.

Thank you very much,
Mike

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Error when trying to import csv: TypeError (can't convert Tempfile into String)

2010-09-02 Thread @demetriusolsen
Can anyone recommend a solution for TypeError (can't convert Tempfile
into String) when I try to import a CSV file? Of course, I'm able to
import to my local Postgresql8.3 db.

Here's the code:

  def csv_import
authorize! :csv_import, ImportStandard

file = params[:csv_import][:file]
logcount=0

Standard.transaction do
  CSV.foreach(file, :headers => true) do |row|
Standard.create!(row.to_hash)
logcount += 1
  end
end

redirect_to(...)
  end

After looking at http://docs.heroku.com/constraints, I'm not sure if I
can even import CSV to my app. However, I did read a few CSV importing
related posts in the Heroku google group so I'm not giving up
hope. :-)

Thanks in advance! Cheers!

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Problem with Heroku gem

2010-09-02 Thread Pedro Sena
Hi Guys,

I'm on ubuntu 10.04 using ruby 1.8

When I try to run heroku gem I get the following error:

pe...@pedro: heroku
/var/lib/gems/1.8/gems/heroku-1.9.14/lib/heroku/client.rb:2:in `require': no
such file to load -- rest_client (LoadError)
from /var/lib/gems/1.8/gems/heroku-1.9.14/lib/heroku/client.rb:2
from /var/lib/gems/1.8/gems/heroku-1.9.14/lib/heroku.rb:3:in `require'
from /var/lib/gems/1.8/gems/heroku-1.9.14/lib/heroku.rb:3
from /var/lib/gems/1.8/gems/heroku-1.9.14/bin/heroku:6:in `require'
from /var/lib/gems/1.8/gems/heroku-1.9.14/bin/heroku:6

But I have rest-client installed on my machine:

pe...@pedro: gem list | grep "rest"
rest-client (1.4.2)

I'd like to know if someone else has seen this error before.

Best Regards

-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: Bundler 1.0.0 Rollout

2010-09-02 Thread Gabriel
Maybe I'm missing something obvious, but can't you specify a group for
those gems and then only deploy them in dev and test?  So as part of
your deployment to heroku you'd do something like: bundle install --
without gems_heroku_dun_like

I'm going to have to deal with exactly the same problem so I'm curious
if this will work for you.

Gabriel

On Aug 31, 11:32 am, Ashley Moran 
wrote:
> On 30 Aug 2010, at 23:54, Terence Lee wrote:
>
> > In the near future we're going to start requiring the Gemfile.lock to be
> > checked into your git repository since this is the recommended deploy
> > path set by the bundler team.  Please take the time to do so if you
> > haven't already.
>
> There's an unfortunate downside to this.  Our Gemfile has gems that can't be 
> built on Heroku (autotest-fsevent, for example).  We avoided deployment 
> issues by altering the Gemfile to only bundle these on OS X:
>
>     if RUBY_PLATFORM =~ /darwin/
>       gem "autotest-fsevent"
>       # ...
>     end
>
> Then, we deliberately left the lock file out of Git so that Heroku would 
> bundle correctly without these gems while compiling the slug.
>
> Today we tried to update our deployment scripts to keep the lockfile in Git.  
> This now means we have to have a Rake task to set an environment variable 
> ENV["HEROKU"], re-bundle with a Gemfile that now looks like this...
>
>   unless ENV["HEROKU"]
>     gem "autotest-fsevent"
>     # ...
>   end
>
> ...then commit the lockfile to Git, and finally push to Heroku.
>
> We have other issues that I think we can resolve.  But the above feels like a 
> lot of hoop-jumping to get a lockfile on Heroku.
>
> I'd love to know if anyone has a solution to this problem.  Last time I asked 
> nobody had a simple workaround.  But that was April, I think, and Bundler and 
> Heroku have both changes since then.
>
> Or, are we alone in having OSX-specific gems in our Gemfile?
>
> Advice much appreciated
>
> Cheers
> Ash
>
> --http://www.patchspace.co.uk/http://www.linkedin.com/in/ashleymoran

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: html to pdf on heroku

2010-09-02 Thread Filip
Hello Alex,
i have recently ran into same problem with wkhtmltopdf,
on my fairly complex view it timed out, while on simple (i.e CRUD
views) it worked fine.
I assume you are using pdfkit gem's middleware to simply generate the
files.

If that is the case, turn the middleware off and configure your pdf
print in respond_to block in your controller's action
This worked for me, now even the complex view generates as quickly as
the simple views and i have complete control over which action gets a
pdf view

Hope it helps,
Filip

On 24 srp, 14:14, Alex Killough  wrote:
> Hi all--
>
> I'm attempting to render a pdf of an html view in my sinatra app.  
> Locally, wkhtmltopdf works, but times-out on heroku. I'd prefer not to  
> shell over an additional $20/month and set up delayed jobs; is there  
> an alternate route anyone has had success with? PrinceXML is out due  
> to price, and I'm a bit scared off by prawn due to syntax and the git  
> submodule issue.
>
> Many thanks,
> Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



How to deploy app with sensitive config information?

2010-09-02 Thread dnagir
Hi,

Deployment to Heroku is done as a Git push.
For git I configure my app not to include any sensitive information so
it will not appear anywhere.
This includes email, payment gateway credentials, encryption key, etc.

So how would I deploy that information together with the application
without storing it in git?

Cheers,
Dmytrii.

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



Re: client_encoding and dealing with Asian characters.

2010-09-02 Thread Stephen Cremin
I have no problem with Chinese, Thai, Japanese, etc, on Heroku's Postgres
database. I don't believe I ever did anything special to set this up in
Heroku. It just worked.

I did have an error with the mathematical fraction "½", as in Fellini's
movie title, but perhaps that can only be represented in UTF16 or perhaps I
was using a double-width version of the fraction or some other variation.

The fact that I can't see the problematic characters in your message on
GMail in Safari on a Mac suggests its the specific characters you're working
with that are problematic, rather than Asian characters in general.

Stephen


On 2 September 2010 17:59, Abel  wrote:

> I run into the following error whenever I try to run a rake task in
> Heroku:
>
> rake aborted!
> PGError: ERROR:  invalid byte sequence for encoding "UTF8": 0xc1c1
> HINT:  This error can also happen if the byte sequence does not match
> the encoding expected by the server, which is controlled by
> "client_encoding".
> : SELECT "entries"."id" FROM   "entries" WHERE
> ("entries".search_id = 53) AND ("entries"."url" = E'http://
> hi.baidu.com/��/blog/item/4afdfbfe9b2da33f5c60087a.html')
> LIMIT 1
>
> The way I interpret it is that PostGres is not configured to read
> Asian characters and that this can be configured via the
> client_encoding variable, but I don't know where to go from here.
>
> I'm in the process of finding which method is causing this and similar
> errors and applying a begin-rescue block on them, but how do you guys
> configure this variable and deal with Asian characters?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Heroku" group.
> To post to this group, send email to her...@googlegroups.com.
> To unsubscribe from this group, send email to
> heroku+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/heroku?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.



client_encoding and dealing with Asian characters.

2010-09-02 Thread Abel
I run into the following error whenever I try to run a rake task in
Heroku:

rake aborted!
PGError: ERROR:  invalid byte sequence for encoding "UTF8": 0xc1c1
HINT:  This error can also happen if the byte sequence does not match
the encoding expected by the server, which is controlled by
"client_encoding".
: SELECT "entries"."id" FROM   "entries" WHERE
("entries".search_id = 53) AND ("entries"."url" = E'http://
hi.baidu.com/��/blog/item/4afdfbfe9b2da33f5c60087a.html')
LIMIT 1

The way I interpret it is that PostGres is not configured to read
Asian characters and that this can be configured via the
client_encoding variable, but I don't know where to go from here.

I'm in the process of finding which method is causing this and similar
errors and applying a begin-rescue block on them, but how do you guys
configure this variable and deal with Asian characters?

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to her...@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.