# Accessing dll files from rails application

**URL:** <https://www.ruby-forum.com/t/accessing-dll-files-from-rails-application/167491>\
**Category:** Rails\
**Created:** [May 8, 2009, 12:47pm UTC](https://www.ruby-forum.com/t/accessing-dll-files-from-rails-application/167491 "2009-05-08T12:47:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [May 8, 2009, 12:47pm UTC](https://www.ruby-forum.com/t/accessing-dll-files-from-rails-application/167491/1 "2009-05-08T12:47:26Z")

</div>

Hi  
Could anybody please suggest ways to access dll files from a rails  
application?

Thanks in advance  
Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [May 8, 2009, 3:13pm UTC](https://www.ruby-forum.com/t/accessing-dll-files-from-rails-application/167491/2 "2009-05-08T15:13:47Z")

</div>

In what sense do you want to access the dll, and are we talking here  
client  
side or server side?

2009/5/8 Sijo Kg [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [May 8, 2009, 9:10pm UTC](https://www.ruby-forum.com/t/accessing-dll-files-from-rails-application/167491/3 "2009-05-08T21:10:37Z")

</div>

Colin L. wrote:

> In what sense do you want to access the dll, and are we talking here  
> client  
> side or server side?

I would hope the OP is interested in accessing a dll on the server-side.  
I would hope that would not be possible to do client-side. That would be  
mean there would have to be a very bad security hole in the client’s web  
browser.

Assuming it’s happening server-side, the OP’s author should realize that  
do this would render the open, and cross-platform nature of Ruby on  
Rails moot, effectively binding his application to run on Microsoft  
Windows only.

It is, however, common to embed native C code in Ruby applications. This  
happens a lot with Gems. Do this requires compilation for the hardware  
running the Ruby application. This would, of course, require having the  
source code used to create the dll available.

In my opinion it would be much better to create a web service that  
exposes a REST API. That API could then be used to integrate the  
functionality of the dll with the Rails application. This would decouple  
the two system and allow the Rails application to run on any hardware  
and access the web service that depends on the dll.

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [May 9, 2009, 6:22am UTC](https://www.ruby-forum.com/t/accessing-dll-files-from-rails-application/167491/4 "2009-05-09T06:22:31Z")

</div>

Hi  
Thanks for the alternative approcah But I would like to know how can  
I access a dll from rails?(Suppose from server side)

Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [May 9, 2009, 9:44am UTC](https://www.ruby-forum.com/t/accessing-dll-files-from-rails-application/167491/5 "2009-05-09T09:44:21Z")

</div>

You might be better asking this question on a ruby forum rather than  
rails.

I would also suggest trying google first. A search for ‘ruby call dll’  
provides a number of links that may be useful. For example  
[Programming Ruby: The Pragmatic Programmer's Guide](http://www.ruby-doc.org/docs/ProgrammingRuby/html/win32.html).

Colin

2009/5/9 Sijo Kg [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
