I need some help! I'm having trouble getting rails working, I'm stuck with a Application error - Rails application failed to start properly"
I tried following Danger's steps here but when I get to chmod -R 0666 log it tells me:
chmod: `log': Permission denied
I have svn setup and deployed with capistrano. I ran rake db:migrate and the dbs were successfully created. I checked the permissions and the she-bang lines. The Welcome to Rails page comes up, but anything else gives the Application Error.
I'm not seeing any logs being generated. Capistrano makes a symlink log that points to a shared directory. Is that what it's supposed to do? No logs are appearing so I don't know what to troubleshoot. I noticed that files in the script directory had rw -r -r permissions, seems like these should be executable right?
I tried running script/console production just to see if it worked and I get this:
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)
from /usr/local/lib/ruby/1.8/irb/completion.rb:10
from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/bin/irb:13
Here are the some of the files involved, any help would be greatly appreciated!!!!!!!
deploy.rb
set :application, "rcl"
set :repository, "svn+ssh://myuser@64.128.80.102/home/myuser/svn/rcl/"
set :deploy_to, "/home/myuser/rcl/"
set :use_sudo, false
set :checkout, "export"
set :user, "myuser"
role :web, "www.reviewerjunction.com"
role :app, "www.reviewerjunction.com"
role :db, "www.reviewerjunction.com", :primary => true
desc "Tasks to execute after code update"
task :after_update_code, :roles => [:app, :db, :web] do
# fix permissions
run "chmod +x #{release_path}/script/process/reaper"
run "chmod +x #{release_path}/script/process/spawner"
run "chmod 755 #{release_path}/public/dispatch.*"
end
desc "Restarting after deployment"
task :after_deploy, :roles => [:app, :db, :web] do
run "touch /home/myuser/rcl/current/public/dispatch.fcgi"
end
desc "Restarting after rollback"
task :after_rollback, :roles => [:app, :db, :web] do
run "touch /home/myuser/rcl/current/public/dispatch.fcgi"
end
database.yml
development:
adapter: mysql
database: myuser_rclproduction
username: myuser
password: mypass
host: localhost
# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
adapter: mysql
database: myuser_rcltest
username: myuser
password: mypass
host: localhost
production:
adapter: mysql
database: myuser_rclproduction
username: myuser
password: mypass
host: localhost
environment.rb
ENV['RAILS_ENV'] ||= 'development'
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '1.1.6'
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence those specified here
# Skip frameworks you're not going to use (only works if using vendor/rails)
# config.frameworks -= [ :action_web_service, :action_mailer ]
# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )
# Force all environments to use the same logger level
# (by default production uses :info, the others :debug)
# config.log_level = :debug
# Use the database for sessions instead of the file system
# (create the session table with 'rake db:sessions:create')
# config.action_controller.session_store = :active_record_store
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector
# Make Active Record use UTC-base instead of local time
# config.active_record.default_timezone = :utc
# See Rails::Configuration for more options
end
# Add new inflection rules using the following format
# (all these examples are active by default):
# Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
# Include your application configuration below
dispatch.fcgi
#!/usr/local/bin/ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off). A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
# # Default log path, normal GC behavior.
# RailsFCGIHandler.process!
#
# # Default log path, 50 requests between GC.
# RailsFCGIHandler.process! nil, 50
#
# # Custom log path, normal GC behavior.
# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'
RailsFCGIHandler.process!