On Sep 2, 2012, at 4:16 PM, renu mehta wrote:

> Hello,
> 
> I am trying to use Spreadsheet gem to import some data in the db. I open
> a xls as
> 
> member_file=Spreadsheet.open("#{RAILS_ROOT}/public/data/FAMILY-MEMBER.xls")
> 
> but after that when I try to open the file using Excel I get an error
> that file is locked by another user for editing. Only way to release the
> lock is to kill the rails server. And there is no method to close the
> file in the gem. How do I solve this problem? 'Roo' also had the same
> issue. Is there any gem which I can use to import/export the data from
> excel which does not have these issues?

You won't have this issue in production, since the XLS file will never be 
opened by the server, I'm betting. You could simply duplicate the file before 
you open it, or you could look into the gem source and see if there's a missing 
your_file.close method somewhere.

Walter

> 
> Thanks.
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to