Can't access from other computers in network?

Hello,

First of all, I’m new to Rails, fairly new to Ruby, and I know next to
nothing about Apache servers and development over a network, so excuse
me if this is a silly question.

I have Rails 3.0.1, Ruby 1.9.2, MySQL 14.14 and Apache 2.2 set up on a
Debian server on my home network with local ip 192.168.2.7. When I
enter this in address bar on my other computers, the ‘Welcome Aboard’
page shows up. So far, so good. However, when I click 'About your
application’s environment", the following error pops up:

We’re sorry, but something went wrong.

We’ve been notified about this issue and we’ll take a look at it
shortly.

I get the same error when I try to run a Rails application. I looked at
log/production.log, and found the following output:

Started GET “/rails/info/properties” for 192.168.2.15 at 2010-23
09:58:11 -0400
Mysql12::Error (Unknown database ‘hellorails_production’):

When I tried 127.0.0.1 on my server, no error showed up. This leads me
to believe that its either something in my router, or a configuration
issue in Apache. Here is my configuration:

LockFile ${APACHE_LOCK_DIR}/accept.lock
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15

StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerchild 0 StartServers 2 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxClients 150 MaxRequestsPerchild 0 StartServers 2 MaxClients 150 MinSpareThreads 25 MaxSpareThreads 75 ThreadLimit 64 ThreadsPerChild 25 MaxRequestsPerchild 0

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

AccessFileName .htaccess

<Files ~ “^.ht”>
Order allow,deny
Deny from all
Satisfy all

DefaultType text/plain
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn

Include mods-enabled/.load
Include mods-enabled/
.conf
Include httpd.conf
Include ports.conf

LogFormat “%v:%p %h %l %u %t “%r” %>s %0 “%{Referer}i”
“%{User-Agent}i”” vhost_combined
LogFormat “%h %l %u %t “%r” %>s %0 “%{Referer}i” “{User-Agent}i””
combined
LogFormat “%h %l %u %t “%r” %>s %0” common
LogFormat “%{Referer}i -> %U” referer
LogFormat “%{User-agent}i” agent

Include conf.d/
Include sites-enabled/

LoadModule passenger_module
/var/lib/gems/1.9.1/gems/passenger-3.0.0/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.9.1/gems/passenger-3.0.0
PassengerRoot /usr/bin/ruby1.9.1

I realize that Rails doesn’t work with Ruby 1.9.1; If i type in
ruby1.9.1 -v, it outputs ruby 1.9.2p0 (2010-08-18 revision 29036)
[x86_64-linux] so I think it should be fine.

Here is my virtual host file:
<VirtualHost *:80>
ServerAdmin [email protected]

DocumentRoot /home/kota/srv/hellorails/public

Options FollowSymLinks
AllowOverride All

<Directory /home/kota/srv/hellorails/public>
Options Indexes FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory “/usr/lib/cgi-bin”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog ${APACHE_LOG_DIR}/error.log

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ “/usr/share/doc/”
<Directory “/usr/share/doc/”>
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128

I am going through a Belkin wireless router. Any ideas?

Thanks!

At first glance what seem to have happen is that you are developing and
then trying to see the results in a production environment
but didnt know that rake task run in development environment by default,
so,
when you ran rake db:migrate in the “production server”
you were expecting to migrate the production database but it didnt since
you
did not specified the environment with RAILS_ENV=“production”, so rails
which is running in production mode in the apache has no production
database, you are seen result in the console when you migrate but all
that
is happening to the development database . Confirm this by accessing
mysql
and typing show databases, the production db should be missing. To fix
this
run rake db:migrate specifying the environment.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs