Noob question about development mode


#1

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?


#2

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 W. removed_email_address@domain.invalid


#3

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 W. removed_email_address@domain.invalid

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.


#4

Kyle W. 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


#5

are you trying to develop on your local machine?


#6

Mark Reginald J. wrote:

Kyle W. 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…


#7

Okay, I think that I may have spoken too soon.

I’ve been following this guide
http://guides.rubyonrails.org/getting_started_with_rails.html
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

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?


#8

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 W. removed_email_address@domain.invalid