I compiled a C++ SWIG interface. It works fine from irb (interactive Ruby). But, I''d like to embed this Swig module into a Rails application. (I did not write this particular Rails application and know very little about Rails per-se.) I know that, to start WEBrick, you say ruby script/server I looked at script/server and it does not look like the right place to stick the "require" line needed for loading the Swig module. Is there a standard place where initial loading of modules should happen? What is the recommended method in this case? Thanks! -- Posted via http://www.ruby-forum.com/.
Robert Br wrote:> I looked at script/server and it does not look like the right place to > stick the "require" line needed for loading the Swig module. > > Is there a standard place where initial loading of modules should > happen? What is the recommended method in this case? > > Thanks!If you have a few hours to spare (guess not!) I''ll suggest check the RubyOnRails documentation and manuals @ www.rubyonrails.com The short answer: there is a file called environment.rb in config folder. There is where your custom requires must reside. HTH, Luis -- Posted via http://www.ruby-forum.com/.
I compiled a C++ SWIG interface. It works fine from irb (interactive Ruby). But, I''d like to embed this Swig module into a Rails application. (I did not write this particular Rails application and know very little about Rails per-se.) I know that, to start WEBrick, you say ruby script/server I looked at script/server and it does not look like the right place to stick the "require" line needed for loading the Swig module. Is there a standard place where initial loading of modules should happen? What is the recommended method in this case? Thanks!
On Feb 27, 2006, at 1:51 PM, Robert Br wrote:> I compiled a C++ SWIG interface. It works fine from irb (interactive > Ruby). But, I''d like to embed this Swig module into a Rails > application. (I did not write this particular Rails application and > know very little about Rails per-se.) > > I know that, to start WEBrick, you say > > ruby script/server > > I looked at script/server and it does not look like the right place to > stick the "require" line needed for loading the Swig module. > > Is there a standard place where initial loading of modules should > happen? What is the recommended method in this case? > > Thanks! > > -- > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > \Put the require in RAILS_ROOT/config/environment.rb at the bottom. That is the standard place for this type of stuff. Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra@yakima-herald.com