Reputation: 73
I'm a brand new Rails user, I'm following this tutorial- http://ruby.railstutorial.org/chapters/a-demo-app#top . Had no issues accessing the demo app (from Chapter 2) on the local server. However having issues deploying to my Linode server. Here's what I've done:
Update VirtualHost for preziki:
ServerAdmin [email protected] ServerName preziki.com ServerAlias www.preziki.com DocumentRoot /srv/www/preziki/first_app/public ErrorLog /srv/www/preziki/logs/error.log CustomLog /srv/www/preziki/logs/access.log combined
a2ensite preziki
If I go to www.preziki.com (or 176.58.104.181), I see the default Rails "Welcome aboard" page. If you click the "About your application environment" link, you get the "Sorry but something went wrong" error. If I go to www.preziki.com/users, (like I could with localhost/users), I get teh "Sorry but something went wrong" error.
If I point VirtualHost to the dir where I have a "Hello world!" index.html file, then preziki.com displays it without a problem.
What am I doing wrong?
Thank you.
Upvotes: 0
Views: 652
Reputation: 921
First thing you can see the "default Rails" environment, means check your web server(apache) is working fine. because its a static request.
Second things when you want to go into application environment, then their is a problem means your application is not deploy properly.
Few thing you need to check.
1. Give the application directory all permission.
2. bundle install properly
3. Set RailsENV in virtual host
4. rake db:migrate properly.
5. Check your log file what problem it is showing.
<VirtualHost *:80>
ServerName localhost
DocumentRoot /home/user/project/trunk/public
PassengerEnabled on
RailsEnv development
<Directory /home/user/project/trunk/public>
</Directory>
</VirtualHost>
Upvotes: 1
Reputation: 16769
It sounds like you're nearly there. My guess is that the app has a problem connecting to the database. But to see for yourself what the problem is, look in the production log file:
/srv/www/preziki/first_app/log/production.log
That will usually tell you everything you need to know. Another thing you can do to debug is to use the console on the server, in production mode:
bundle exec rails console production
Upvotes: 0