Is it possible to set up the database.yml file to connect to a sqlite database via http://? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Also I have apache running off port 84 and my ROR app running off port 3000. I can only get PHP to execute using the apache port. The issue is that I need to access the ROR db using the PHP file. How would I go about doing this so that the PHP script can "see" the ROR db file located in its default directory within my ROR app? On Aug 24, 9:51 pm, Xenio <yax...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is it possible to set up the database.yml file to connect to a sqlite > database via http://?-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Xenio wrote:> Also I have apache running off port 84 and my ROR app running off port > 3000. I can only get PHP to execute using the apache port. > > The issue is that I need to access the ROR db using the PHP file. > > How would I go about doing this so that the PHP script can "see" the > ROR db file located in its default directory within my ROR app?Presumably by giving the PHP application the appropriate SQLite connection information. But you shouldn''t do that if this is a production solution: SQLite is not suitable for production use due to its lack of concurrency support. Use a real multiuser DB such as PostgreSQL. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
This situation is that I have an iphone app in development that uses the db. I just need to make the admin interface to edit the needed data. I''m starting to think Ruby was the worst choice for somethign non-standard like this. But I''m pretty far in and I finished everything except the part where the iphone app dev can upload a php file to test his app script against the db. Thanks for your response Marnen. sqlite is just a file so the connection info is the tricky part for me. The ROR app is running in a c:\users directory, while the php script is in the main apache htdoc directory which is like c:\program files \rubystack\apache2\blah blah blah How would I write that file as far as the path to the sqlite db? On Aug 25, 10:49 am, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Xenio wrote: > > Also I have apache running off port 84 and my ROR app running off port > > 3000. I can only get PHP to execute using the apache port. > > > The issue is that I need to access the ROR db using the PHP file. > > > How would I go about doing this so that the PHP script can "see" the > > ROR db file located in its default directory within my ROR app? > > Presumably by giving the PHP application the appropriate SQLite > connection information. But you shouldn''t do that if this is a > production solution: SQLite is not suitable for production use due to > its lack of concurrency support. Use a real multiuser DB such as > PostgreSQL. > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > Sent from my iPhone > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Xenio wrote:> This situation is that I have an iphone app in development that uses > the db. I just need to make the admin interface to edit the needed > data. I''m starting to think Ruby was the worst choice for somethign > non-standard like this.Maybe; maybe not. It''s not clear from your description.> > But I''m pretty far in and I finished everything except the part where > the iphone app dev can upload a php file to test his app script > against the db. > > > Thanks for your response Marnen. > sqlite is just a file so the connection info is the tricky part for > me. > The ROR app is running in a c:\users directory, while the php script > is in the main apache htdoc directory which is like c:\program files > \rubystack\apache2\blah blah blah > > How would I write that file as far as the path to the sqlite db?I have no idea. Probably by supplying the path to the SQLite dbfile. This has nothing to do with Rails, and would be better directed to a SQLite or PHP forum. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Cool thanks for the direction. I wasn''t sure if this still fell under ROR or not. I figured since I was usiing the Bitnami Rubystack that isntalls everything at once I was maybe hoping someone else who uses that deployment package might have a hint. But I will look into the PHP, SQLite forums and see what I come up with. But... as far as my first question which would save me from trying the previous method above would be to see if there is a way to reference a sqlite db file via http or ip address in the database.yml file within the Ruby Rails app folder. On Aug 25, 11:19 am, Marnen Laibow-Koser <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Xenio wrote: > > This situation is that I have an iphone app in development that uses > > the db. I just need to make the admin interface to edit the needed > > data. I''m starting to think Ruby was the worst choice for somethign > > non-standard like this. > > Maybe; maybe not. It''s not clear from your description. > > > > > But I''m pretty far in and I finished everything except the part where > > the iphone app dev can upload a php file to test his app script > > against the db. > > > Thanks for your response Marnen. > > sqlite is just a file so the connection info is the tricky part for > > me. > > The ROR app is running in a c:\users directory, while the php script > > is in the main apache htdoc directory which is like c:\program files > > \rubystack\apache2\blah blah blah > > > How would I write that file as far as the path to the sqlite db? > > I have no idea. Probably by supplying the path to the SQLite dbfile. > This has nothing to do with Rails, and would be better directed to a > SQLite or PHP forum. > > Best, > -- > Marnen Laibow-Koserhttp://www.marnen.org > mar...-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 25 Aug 2010, at 17:29, Xenio wrote:> I wasn''t sure if this still fell under ROR or not. I figured since I > was usiing the Bitnami Rubystack that isntalls everything at once I > was maybe hoping someone else who uses that deployment package might > have a hint. > > But I will look into the PHP, SQLite forums and see what I come up > with. > > But... as far as my first question which would save me from trying the > previous method above would be to see if there is a way to reference a > sqlite db file via http or ip address in the database.yml file within > the Ruby Rails app folder.I haven''t been following the discussion too much, but SQLite is a filebased local database engine, it can''t be accessed remotely unless you have some kind of a thirdparty server application that runs on top of SQLite. That''s why RoR doesn''t support a host in the database.yml config for SQLite databases: you can''t do it with SQLite, period. If you need network access, you could put it in a shared folder and access it that way, but I would be scared sh**less if more than one client will access the db at the same time. Best regards Peter De Berdt -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Well that''s that. Thanks for the clarification. So now thats out the picture, what about this? Is there a way to have php execute within a Ruby App. Can I put a php file in the public directory that can access the DB in its default directory? On Aug 25, 11:37 am, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> On 25 Aug 2010, at 17:29, Xenio wrote: > > > I wasn''t sure if this still fell under ROR or not. I figured since I > > was usiing the Bitnami Rubystack that isntalls everything at once I > > was maybe hoping someone else who uses that deployment package might > > have a hint. > > > But I will look into the PHP, SQLite forums and see what I come up > > with. > > > But... as far as my first question which would save me from trying the > > previous method above would be to see if there is a way to reference a > > sqlite db file via http or ip address in the database.yml file within > > the Ruby Rails app folder. > > I haven''t been following the discussion too much, but SQLite is a > filebased local database engine, it can''t be accessed remotely unless > you have some kind of a thirdparty server application that runs on top > of SQLite. That''s why RoR doesn''t support a host in the database.yml > config for SQLite databases: you can''t do it with SQLite, period. > > If you need network access, you could put it in a shared folder and > access it that way, but I would be scared sh**less if more than one > client will access the db at the same time. > > Best regards > > Peter De Berdt-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Please quote when replying. Otherwise it''s impossible to follow the discussion. Xenio wrote:> Well that''s that. Thanks for the clarification. So now thats out the > picture, what about this? > > Is there a way to have php execute within a Ruby App.Not really.> Can I put a php > file in the public directory that can access the DB in its default > directory?Why would you want to? Just tell the PHP application where the DB is and how to connect to it. This should not be difficult, but exact instructions are off topic for the Rails mailing list. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 25 Aug 2010, at 21:26, Xenio wrote:> Well that''s that. Thanks for the clarification. So now thats out the > picture, what about this? > > Is there a way to have php execute within a Ruby App. Can I put a php > file in the public directory that can access the DB in its default > directory?Why would you need to do that? Just make sure the permissions on the SQLite database file allow both your PHP app and your Rails app to access it. Then connect to the SQLite from your PHP app using the path. But again, this is no different than putting it on a network share: you access the same file with two processes, which is a bad idea. Compare it to throwing one bone to two dogs, they''ll fight over it and eventually damage it. It''s been said once, and it will be said again: if you want multiuser access to your database, use a database that supports it, i.e. MySQL or PostgreSQL. Best regards Peter De Berdt -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I found a solution for my issues. I just pointed the default directory of apache to the same dir the db was in. just on another port. quick fix. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.