SapphireSteel Forum
Welcome, Guest. Please login or register.
June 19, 2013, 09:18:55 PM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Sapphire and Amethyst IDEs
3893 Posts in 803 Topics by 672 Members
Latest Member: davib
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Sapphire / Ruby In Steel
| | |-+  LightTPD/Webrick not working correctly
« previous next »
Pages: [1] Print
Author Topic: LightTPD/Webrick not working correctly  (Read 6110 times)
thumper631
Registered User
Newbie
*
Posts: 7


« on: April 07, 2007, 03:07:12 PM »

Good day.

I have been trying to do some rails development in the Ruby in Steel editor and seem to be having some issue.  The application looks as if it is generating the project ok and when I do a http://localhost:3000, I get the rails page.  The issue seems to be when I go outside of the default page.  I follow the example in debugging (http://www.sapphiresteel.com/Debugging-Ruby-On-Rails) and switch to LightTPD and the same issue using port 81.  Internet Explorer cannot display the webpage.

I next try using RadRails and opening up the project.  Start webrick, surf to page hpps://hocalhost:3000/helloworld and the page display correctly.  Wonder if you can point me in the right direct to look.

Thanks

James
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #1 on: April 07, 2007, 04:10:12 PM »

WEBrick generally defaults to post 3000 and LightTPD to 80 (unless you've set something different in the lighttpd.conf file in the /Scripts folder under your RiS installation). So if you are using LightTPD with Ruby In Steel, have you tried using localhost:80 when trying to view web pages? You will also need to use the appropriate scripts as expained in the tutorial. Remember too that LightTPD needs to be started as a separate action whereas WEBrick is started automatically (as it's written in Ruby, we can 'run' it). In general, WEBrick is much easier to use than LightTPD. If you are having problems with LightTPD, I'd suggest you switch to WEBrick (change the debug scripts as explained in the tutorial) and then just click the One-click debugger to kick off WEBrick to run (and debug, if you like) your application.

I think the tutorial you reference may suggest using LightTPD as the default due to problems dealing with Ruby threads under WEBrick. We've since made the Cylon debugger thread-safe so you can now debug with WEBrick, Mongrel lor LightTPD. See here more more info:

http://www.sapphiresteel.com/Debugging-Ruby-on-Rails,117
http://www.sapphiresteel.com/Big-Improvements-for-Ruby

best wishes
Huw
Logged
thumper631
Registered User
Newbie
*
Posts: 7


« Reply #2 on: April 08, 2007, 10:22:45 AM »

Huw.

Thanks for your help on this, I reset everything back to webrick and it seems to be working.  However now the issue is that when I do the One Click debug and run the webpage as shownin in your debugging example, I get the following error/message with the statement that ruby stop.

Running WebBrick service ...
RAILS_ROOT: D:/prj/Visual Studio 2005/Projects/Rails4/Rails4
=> Booting WEBrick...
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-04-08 10:21:01] INFO  WEBrick 1.3.1
[2007-04-08 10:21:01] INFO  ruby 1.8.6 (2007-03-13) [i386-mswin32]
[2007-04-08 10:21:01] WARN  TCPServer Error: Bad file descriptor - bind(2)
c:\ruby\lib\ruby\1.8\webrick\utils.rb:73:in `initialize': Bad file descriptor - bind(2) (Errno::EBADF)
   from c:\ruby\lib\ruby\1.8\webrick\utils.rb:73:in `new'
   from c:\ruby\lib\ruby\1.8\webrick\utils.rb:73:in `create_listeners'
   from c:\ruby\lib\ruby\1.8\webrick\utils.rb:70:in `each'
   from c:\ruby\lib\ruby\1.8\webrick\utils.rb:70:in `create_listeners'
   from c:\ruby\lib\ruby\1.8\webrick\server.rb:75:in `listen'
   from c:\ruby\lib\ruby\1.8\webrick\server.rb:63:in `initialize'
   from c:\ruby\lib\ruby\1.8\webrick\httpserver.rb:24:in `initialize'
   from c:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.3\lib\webrick_server.rb:58:in `new'
    ... 7 levels...
   from c:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.3\lib\commands\server.rb:39
   from c:\ruby\lib\ruby\site_ruby\1.8\rubygems\custom_require.rb:27:in `gem_original_require'
   from c:\ruby\lib\ruby\site_ruby\1.8\rubygems\custom_require.rb:27:in `require'
   from C:\Program Files\SapphireSteel Software\Ruby In Steel\v1.0\Scripts\webbrick_service.rb:6

I hope that this makes some sense

Ruby version 1.8.6 (i386-mswin32)
RubyGems version 0.9.2
Rails version 1.2.3
Active Record version 1.15.3
Action Pack version 1.13.3
Action Web Service version 1.2.3
Action Mailer version 1.3.3
Active Support version 1.4.2
Application root D:/prj/Visual Studio 2005/Projects/Rails4/Rails4
Environment development

Thanks again for your help on this great application.

James
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #3 on: April 08, 2007, 10:45:13 AM »

It looks as though something else is hanging onto port 3000 (maybe you are running another server?). You can try using a new port (e.g. 3001 or 3003 or similar) in Tools, Options, Projects and Solutions, Ruby In Steel. Then enter that port in the browser (e.g. http://localhost:3001 followed by the full path...

best wishes
Huw
Logged
thumper631
Registered User
Newbie
*
Posts: 7


« Reply #4 on: April 09, 2007, 07:35:59 AM »

Morning/Afternoon Huw.

More than once, I read how quick you are to response to people issues and this one has been no exception.  I am writing this email from work and because of this reason cannot give you a list of the error I was receiving late last night (shouldn't have gone to bed, damn the need for sleep :0).  The issue from what I can remember is that utils.rb in the webrick directory fails on the require "fcntl" and "etc".  Now I know how hard it is to debug someone else system when you are not there so I have 2 simple question.

1) Is there somewhere one can check pathing/includes for directory to ensure that the pathing is correct?
2) What is the process to start over again?  I try it one but may have drop the ball somewhere along the process (Remove Ruby directory, reinistall ruby, reinstall the rails framework).

Overall I was able to connect to the web page on port 3004 and then was able to connect to MSSql database and see my data.  It just the Single Click Debug that I seem to have an issue with.

Thanks once again.

James
« Last Edit: April 09, 2007, 08:14:20 AM by thumper631 » Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #5 on: April 09, 2007, 11:27:15 AM »

Morning/Afternoon Huw.

More than once, I read how quick you are to response to people issues and this one has been no exception.  I am writing this email from work and because of this reason cannot give you a list of the error I was receiving late last night (shouldn't have gone to bed, damn the need for sleep :0).  The issue from what I can remember is that utils.rb in the webrick directory fails on the require "fcntl" and "etc". 
This should work if the correct port is used. I've added an entry on this to the FAQ: http://www.sapphiresteel.com/When-I-try-to-debug-a-Rails

I'd be grateful if you'd read through this and let me know if this describes (and solves?) your problem. If not, can you give me a fairly detailed step-by-step description so that I can see exactly where the problem arises.

Quote
1) Is there somewhere one can check pathing/includes for directory to ensure that the pathing is correct?
Do you mean, the paths set up inside Ruby In Steel? All the paths to Ruby, databases and servers are set in Tools->Options->Projects and Solutions->Ruby In Steel.

Quote
2) What is the process to start over again?  I try it one but may have drop the ball somewhere along the process (Remove Ruby directory, reinistall ruby, reinstall the rails framework).
You shouldn't need to reinstall Ruby (unless you've done something to change the contents of its files or directories). You can, in fact, have multiple installations of Ruby (the same or different versions) on a single PC. Just pick the version you want to use in the RiS Options. You can install Rails using a Gem gem install rails --include-dependencies (or just enter rails --include-dependencies in the RiS Gems dialog).

Quote
It just the Single Click Debug that I seem to have an issue with.
If WEBrick is running on the correct port and you have the two WEBrick scripts loaded (webbrick_service.rb and webbrick_server.bat which are loaded into the two bottom fields of the Options dialog mentioned earlier) the One-click debugger should work fine.

As I say, if you are still having problems, we may need to go through the whole process step-by-step. If we can't resolve this soon, maybe you can get in touch using the suppport email (see the Contacts page) and I'll try to guide you through the process one step at a time...  Smiley

I have a feeling that it's the presence of multiple servers on your PC that may have caused some side effects. Apart from WEBrick and LightTPD, are you using any others (Mongrel, for example)?

best wishes
Huw
Logged
thumper631
Registered User
Newbie
*
Posts: 7


« Reply #6 on: April 09, 2007, 03:34:30 PM »

Huw.

Well I made it much further and this what i did.  When following your instruction from http://www.sapphiresteel.com/When-I-try-to-debug-a-Rails you mention the following

NOTE: If, at this stage, you see an error message stating that "port: 80" is already in use, you will need to edit LightTPD’s port manually to some other value. This is set in the LightTPD configuration file, lighttpd.conf, in the \config directory under your current Rails application’s directory. Open this file in Visual Studio and search for the following entry:
#server.port  = 81
and remove the comment ’#’, so that the entry is now:
server.port  = 81
Save the file and try to start LightTPD again (as explained above).


And I believe that this might be the issue.  I have a webrick server running then I start the one click debug which must start it own server.  If I stop the first server and only run the one click everything seems to be working fine now....  Not sure if I was again skip over the instruction of not having your webrick running during the one click debug Smiley

The only other issue at this moment (thou I am sure that we will talking again) is I am getting the following error message

Error   1   The target "ResolveAssemblyReferences" does not exist in the project.   D:\prj\Visual Studio 2005\Projects\oneclicktesterP\oneclicktesterP\oneclicktesterP.stproj   0   1   oneclicktesterP

Once again thank you for taking the time to help me out with this

James


p.s.

The error message that you had posted is the same message I was getting thou the last line was different.

        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from ./script/server:3
"Server terminated"
Press any key to continue . . .






« Last Edit: April 09, 2007, 03:38:59 PM by thumper631 » Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #7 on: April 09, 2007, 03:53:00 PM »

Hmmm... well, at least you are getting different error messages now!  Wink

'ResolveAssembleyReferences' rings a bell. I have a feeling I get that one in my C# projects from time to time. I can't recall in which circumstances, though. I'll have to save that one up for tomorrow, I think, as it's getting a bit late here in the UK now (around 11pm) and I have to take the dog out for her late night walk...  Smiley

I'll see if I can get the bells ringing again on that error message tomorrow.

best wishes
Huw
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #8 on: April 10, 2007, 06:45:52 AM »

I'm a bit baffled about the ResolveAssemblyReferences error. I haven't been able to produce this (after quite a few attempts)  Embarrassed .

Essentially, ResolveAssemblyReferences is a task that is executed by VS during the Build process. We added a references node to Ruby projects in the latest release of RiS (022). Currently this has no effect but will provide us with a few useful capabilities in future.

Can you see the References node in your RiS project in the Solution Explorer? If so, are there any subnodes (that is, have you tried to Add a reference to it?). Also, is the project you are running one that was created prior to the latest RiS update (before we used the References node) or was it created afresh in RiS 022?

Finally, does this error actually cause any problems? Or is the message displayed but no problems then occur?

best wishes
Huw
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #9 on: April 10, 2007, 11:18:31 AM »

I have finally managed to produce this error. But only in a mixed language solution containing both C# and Ruby projects. When I build the entire solution or just a selected C# project, the error message appears. When I build just the Ruby project I don't see the error message. Are you building a multi-language and/or multi-project Solution?

To the best of our knowledge this 'error' is harmless and can be ignored. It seems to be a Task which is run by the MSBuild system for some languages but is not relevant to Ruby. You can cause the error message to go away by editing the project file by hand - but we don't recommend that you do this (if you really, really want to, contact us by email and we'll tell you how). For now, I'd recommend that you just ignore the message. We'll add a fix to get rid of it in the next update of the software.
« Last Edit: April 10, 2007, 11:37:45 AM by Huw Collingbourne » Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!