Forum: Ruby on Rails noob question about development mode

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
36d5d019f5e4b14e0006f0dbc4d42832?d=identicon&s=25 Kyle Wakefield (expozen)
on 2009-01-20 06:35
I'm new to Ruby and have just installed Rails. I wondering if there is a
way to add an ip address to be used for development mode, it seems to
default to localhost. I would like to view the Rails applications I
development from a browser other than the on installed locally. When I
try to do this now, all the page requests are directed to production
mode (I'm quessing because to source ip address isn't 127.0.0.1). Is
there some way to direct requests made from 192.168.0.3 to use
development mode?
Dfe81d0ef18761dc22d0586b7b58c5ac?d=identicon&s=25 Rob Zolkos (rzolkos)
on 2009-01-20 09:35
(Received via mailing list)
you should be able to access your app in development mode from any
browser on your network :

just type in the ip address of your server (the one with the rails
app) and port 3000 (the default port when running the built-in server
in dev mode)

eg if your server ip address is 192.168.0.1 then

http://192.168.0.1:3000   from any browser on your network

hope this helps !

Rob

On Jan 20, 4:35 pm, Kyle Wakefield <rails-mailing-l...@andreas-s.net>
36d5d019f5e4b14e0006f0dbc4d42832?d=identicon&s=25 Kyle Wakefield (expozen)
on 2009-01-20 17:14
Rob Zolkos wrote:
> you should be able to access your app in development mode from any
> browser on your network :
>
> just type in the ip address of your server (the one with the rails
> app) and port 3000 (the default port when running the built-in server
> in dev mode)
>
> eg if your server ip address is 192.168.0.1 then
>
> http://192.168.0.1:3000   from any browser on your network
>
> hope this helps !
>
> Rob
>
> On Jan 20, 4:35�pm, Kyle Wakefield <rails-mailing-l...@andreas-s.net>

That helps a lot! The guide I've been following never actually explained
why port 3000 was to be used, and I never got it working because I had
ignorantly specified port 80 for the Apache virtual host I added. I've
added a new virtual host for development that uses port 3000 and
everything works the way you explained. Thank you for the help, Rob.
36d5d019f5e4b14e0006f0dbc4d42832?d=identicon&s=25 Kyle Wakefield (expozen)
on 2009-01-21 07:09
Okay, I think that I may have spoken too soon.

I've been following this guide
http://guides.rubyonrails.org/getting_started_with...
and nothing seems to work. Can anyone recommend a better guide for a
beginner?

To get port 3000 to work correctly I configured Apache with the
following virtual host:

Listen 3000
NameVirtualHost 192.168.0.1:*
<VirtualHost 192.168.0.1:*>
   ServerName blog.cadimize.com
   DocumentRoot /home/toper/www/cadimize/blog/public
</VirtualHost>

This makes development mode SEEM like it works, I can access my app from
port 3000, but when there's an error it gets logged to
config/production.log (so it's not in actually development mode).

When I use the WEBrick server, development mode does work, and errors
are logged to config/development.log. But then I can only view my app at
127.0.0.1. When WEBrick starts it says: "Rails 2.1.0 application started
on http://127.0.0.1:3000"

My questions are:
Does development mode only work with the WEBrick server?
If so, I assume I need to configure it to use an address other than
127.0.0.1?
If not, does someone know what I could be missing in my Apache
configuration that is keeping me from accessing development mode?
C64e63b70be7dfed8b0742540b8b27e5?d=identicon&s=25 Mark Reginald James (Guest)
on 2009-01-22 02:01
(Received via mailing list)
Kyle Wakefield wrote:

> If not, does someone know what I could be missing in my Apache
> configuration that is keeping me from accessing development mode?

Are you using Passenger (mod_rails)? If so, you need to add the
"RailsEnv development" option to your VirtualHost config.

--
Rails Wheels - Find Plugins, List & Sell Plugins -
http://railswheels.com
82e31cc9f57fcbd5c797ac4f8e3a7551?d=identicon&s=25 Jason White (silliemunkie)
on 2009-01-22 03:34
(Received via mailing list)
are you trying to develop on your local machine?
36d5d019f5e4b14e0006f0dbc4d42832?d=identicon&s=25 Kyle Wakefield (expozen)
on 2009-01-22 05:24
Mark Reginald James wrote:
> Kyle Wakefield wrote:
>
>> If not, does someone know what I could be missing in my Apache
>> configuration that is keeping me from accessing development mode?
>
> Are you using Passenger (mod_rails)? If so, you need to add the
> "RailsEnv development" option to your VirtualHost config.
>
> --
> Rails Wheels - Find Plugins, List & Sell Plugins -
> http://railswheels.com

Yes, I am using Passenger. The RailsEnv option was the fix. Thanks for
the Reply, I don't think I would have found that one. I was busy looking
though the Apache and Rails options; I kind of forgot that I even
installed Passenger.




Jason White wrote:
> are you trying to develop on your local machine?

I'm trying to develop on a local server from another machine. It's
probably not the easiest/best way to go but I don't really know enough
to know the difference yet...
247cd3d37084a3d6794076207bd9fbd7?d=identicon&s=25 Bobnation (Guest)
on 2009-01-22 05:46
(Received via mailing list)
Interesting way of doing things, and I'm not 100% sure what your OS
environments on your machines are, but it really is kind of nice to be
able to develop on separate machines with something as simple as "thin
start" on the machine and the using Git to handle the source.

Just an idea.

On Jan 21, 10:24 pm, Kyle Wakefield <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.