Problem in MAC OSX Lion Run debuging on port80

hi,

I am getting the following error in rubymine 4.5

/Users/macuser/.rvm/rubies/ruby-1.9.2-p320/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/macuser/.rvm/gems/ruby-1.9.2-p320/gems/ruby-debug-ide-0.4.17.beta14/bin/rdebug-ide --dispatcher-port 51058 --port 51059 -- /Users/macuser/Sites/movielala/www/script/rails server webrick -b 127.0.0.1 -p 80 -e development
Fast Debugger (ruby-debug-ide 0.4.17.beta14, ruby-debug-base 0.11.30.pre10) listens on 127.0.0.1:51059
=> Booting WEBrick
=> Rails 3.2.2 application starting in development on http://127.0.0.1:80
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
[2012-07-16 21:51:12] INFO  WEBrick 1.3.1
[2012-07-16 21:51:12] INFO  ruby 1.9.2 (2012-04-20) [x86_64-darwin11.3.0]
[2012-07-16 21:51:12] WARN  TCPServer Error: Permission denied - bind(2)
Uncaught exception: Permission denied - bind(2)
 /Users/macuser/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize'
 /Users/macuser/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/utils.rb:73:in `new'
 /Users/macuser/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/utils.rb:73:in `block in create_listeners'
 /Users/macuser/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/utils.rb:70:in `each'
 /Users/macuser/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/utils.rb:70:in `create_listeners'
 /Users/macuser/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:74:in `listen'
 /Users/macuser/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:62:in `initialize'
 /Users/macuser/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:24:in `initialize'
 /Users/macuser/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.1/lib/rack/handler/webrick.rb:10:in `new'
 /Users/macuser/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.1/lib/rack/handler/webrick.rb:10:in `run'
 /Users/macuser/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
 /Users/macuser/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/commands/server.rb:70:in `start'
 /Users/macuser/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/commands.rb:55:in `block in <top (required)>'
 /Users/macuser/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/commands.rb:50:in `tap'
 /Users/macuser/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/commands.rb:50:in `<top (required)>'
 /Users/macuser/Sites/movielala/www/script/rails:6:in `require'
 /Users/macuser/Sites/movielala/www/script/rails:6:in `<top (required)>'


When I run the following in the terminal , I have no problem.

rvmsudo rails server -p 80 -e development

9 comments
Comment actions Permalink

We do not use rvmsudo to run server, this is why it can not listen on port 80.
Is it important to you this port to run it in debugging?

Regard, Oleg.

0
Comment actions Permalink

Oleg,

It is important to bind it to port 80 because of several reasons.

1) I can use the domain movielala.com instead of localhost.
2) If I use movielala.com (which resolves 127.0.0.1) so I can use same real facebook app .
3) It helps debugging a lot.
....

can u tell me anyway how I can run ruby mine in root mode. or rvmsudo rails server -p 80 -e development



PS: in root console, if I run rubymine from command , I get the following errror.
Invalid config path
config path '/var/root/Library/Preferences/RubyMine40 is invalid.

Thanks

0
Comment actions Permalink

I'm not sure if this will work, but you could try to create run configuration based on regular Ruby Run Configuration.
If this work then you a lucky guy. If it is not, you will need to figure out how to configure the system to be able to run the app on different port but
still have everything you need (I'm almost sure that this is possible, but I just do not know how to do this)

Regards, Oleg.

0
Comment actions Permalink

How can i create   configuration based on regular Ruby Run Configuration in config path '/var/root/Library/Preferences/RubyMine40



or how can I change the config path /var/root/Library/Preferences/RubyMine40 to /var/{myuser}/Library/Preferences/RubyMine40

0
Comment actions Permalink

go to "Run"::"Edit Configurations...", press '+' button, select "Ruby" from popup and try to change fields to get required run command.

Oleg.

0
Comment actions Permalink

Edit Configurations are for debugging.


It will be great if you can be more specific?


1) How can i create   configuration based on regular Ruby Run Configuration in config path '/var/root/Library/Preferences/RubyMine40



2) or how can I change the config path /var/root/Library/Preferences/RubyMine40 to/var/{myuser}/Library/Preferences/RubyMine40

0
Comment actions Permalink

Hi,

I've just reilized that there is even simplier solution for your problem:
you can run dev-server on some non-restricted port (>1000) e.g 8080 and setup port forwarding from 80 to 8080
here is a description of one possible way to do this but I'm sure you will find even more.

Hope this helps, Oleg.

0
Comment actions Permalink

Works perfectly.. Amazin solution..

But now there is another thing....

for static files I am getting the following errors in rubymine consolse


Started GET "/assets/site/star.png" for 127.0.0.1 at 2012-07-23 23:26:20 -0700
cache error: Permission denied - (/Users/sahinboydas/Sites/movielala/www/tmp/cache/http%3A%2F%2Fmovielala.com%2Fassets%2Fsite%2Fstar.png%3F20120723-22794-1iutb0w, /Users/sahinboydas/Sites/movielala/www/tmp/cache/2A5/701/http%3A%2F%2Fmovielala.com%2Fassets%2Fsite%2Fstar.png%3F)
Served asset /site/star.png - 304 Not Modified (0ms)
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/fileutils.rb:515:in `rename'
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/fileutils.rb:515:in `block in mv'
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/fileutils.rb:1423:in `block in fu_each_src_dest'
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/fileutils.rb:1439:in `fu_each_src_dest0'
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/fileutils.rb:1421:in `fu_each_src_dest'
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/fileutils.rb:504:in `mv'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/core_ext/file/atomic.rb:35:in `atomic_write'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/cache/file_store.rb:91:in `write_entry'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/cache/strategy/local_cache.rb:140:in `write_entry'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/cache.rb:364:in `block in write'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/cache.rb:520:in `instrument'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.2/lib/active_support/cache.rb:362:in `write'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.2.2/lib/action_dispatch/http/rack_cache.rb:25:in `write'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/rack-cache-1.2/lib/rack/cache/metastore.rb:83:in `store'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/rack-cache-1.2/lib/rack/cache/context.rb:267:in `store'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/rack-cache-1.2/lib/rack/cache/context.rb:232:in `validate'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/rack-cache-1.2/lib/rack/cache/context.rb:181:in `lookup'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/engine.rb:479:in `call'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/application.rb:220:in `call'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.1/lib/rack/content_length.rb:14:in `call'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/railties-3.2.2/lib/rails/rack/log_tailer.rb:14:in `call'
/Users/sahinboydas/.rvm/gems/ruby-1.9.2-p320/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/sahinboydas/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
cache: [GET /assets/site/star.png] stale, valid

0
Comment actions Permalink

most likely you need to execute an appropriate chown/chmod on the webserver's cache or just remove it to start from the blank page.

Oleg.

0

Please sign in to leave a comment.