SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simply Rails 2 final deployment failure (500 Error)

    I'm at the end of Simply Rails 2 book and everything has worked so far, until I tried to deploy the shovell production app on my shared hosting service. I'm getting a 500 Internal Server Error. My host is BlueHost and they are running:
    • Rails 2.2.2 (which is what I developed in)
    • Apache front-end
    • FastCGI back-end (no Mongrel)
    • MySQL (no SQLite)


    I know their configuration works because I created a test app according to their instructions (the top Google search on "How to set up Ruby on Rails Bluehost" has them). I also spent a few hours on the phone with their upper-level support. Together we tested all sorts of things short of getting into the app, and they concluded there was something wrong with my app.

    I know it seems like a really broad question, but if anyone has a suggestion on what I can try to isolate the problem beyond a generic 500 error I'd welcome the help. I feel I've come so far working through all of the book problems it seems a shame that the deployment would fail.

    Here's my database.yml (***** refers to private information)

    Code:
    development:
      adapter: mysql
      database: *****_shovelldev
      host: localhost
      username: *****_rails
      password: *****
      timeout: 5000
    
    production:
      adapter: mysql
      database: *****_shovellprod
      host: localhost
      username: *****_rails
      password: *****
      timeout: 5000
    
    test:
      adapter: mysql
      database: *****_shovelltest
      host: localhost
      username: *****_rails
      password: *****
      timeout: 5000
    Here's my routes.rb:
    Code Ruby:
    ActionController::Routing::Routes.draw do |map|
      map.resources :tags
      # The priority is based upon order of creation: first created -> highest priority.
     
      # Sample of regular route:
      #   map.connect 'products/:id', :controller => 'catalog', :action => 'view'
      # Keep in mind you can assign values other than :controller and :action
     
      # Sample of named route:
      #   map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
      # This route can be invoked with purchase_url(:id => product.id)
     
      # Sample resource route (maps HTTP verbs to controller actions automatically):
      #   map.resources :products
     
      # Sample resource route with options:
      #   map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
     
      # Sample resource route with sub-resources:
      #   map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
     
      # Sample resource route with more complex sub-resources
      #   map.resources :products do |products|
      #     products.resources :comments
      #     products.resources :sales, :collection => { :recent => :get }
      #   end
     
      # Sample resource route within a namespace:
      #   map.namespace :admin do |admin|
      #     # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
      #     admin.resources :products
      #   end
     
      # You can have the root of your site routed with map.root 
      map.root :controller => "stories"
     
      # See how all your routes lay out with "rake routes"
     
      # Install the default routes as the lowest priority.
      # Note: These default routes make all actions in every controller accessible via GET requests. You should
      # consider removing the them or commenting them out if you're using named routes and resources.
      map.resources :stories, :has_many => :votes, :collection => { :bin => :get }
      map.resource :session
      map.resources :users
      map.connect ':controller/:action/:id'
      map.connect ':controller/:action/:id.:format'
    end

    Note: I tried deploying the code from the book, but that was written with Rails 2.0.x so when I tried to do a rake task it failed because the ruby gem version didn't match that of the server.

  2. #2
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Hailsham, UK
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check the log file logs/production.log after getting the error -- this often helps me.

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2009
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    check the log file at production.log if that doesnt work try the web

  4. #4
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I looked at the production.log and it was completely empty. Is there something I need to do to initialize the application in the production environment?

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    16,457
    Mentioned
    160 Post(s)
    Tagged
    1 Thread(s)
    Does your config/environment.rb file have something like this in it
    Code Ruby:
    .....
    # Uncomment below to force Rails into production mode when
    # you don't control web/app server and can't set it the proper way
    # ENV['RAILS_ENV'] ||= 'production'
    .....

  6. #6
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I hadn't uncommented that, so I tried that, but it still didn't work. Thank you for the suggestion, though. If it didn't fail for some other reason, it would have failed for that one.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •