Adam Perfect

General

Deploying a Rails app...

Not as easy as you'd imagine. Today I tried moving my Rails-based CMS code onto my host's server so I could combine a bit of PHP code with it until I get time to re-write in Ruby (image manager plugin for XINHA). Having run rails on the server to create a default Rails directory structure, I then uploaded the /app, /config, /lang, /lib and /public folders to add the application code and settings, changing the config files for the server DB and .htaccess and dispatch files for running on the site5 server. Unfortunately that's as far as I've got so far - the Rails app won't start, logging "premature end of script" errors in the Apache log. Running dispatch.cgi in the shell (.fcgi gives no remotely sensible errors, so just trying to get normal .cgi working for the time being) gives me this:

/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:256:in `send': undefined method `debug_rjs=' for ActionView::Base:Class (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:256:in `initialize_framework_settings' from /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:255:in `initialize_framework_settings' from /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:252:in `initialize_framework_settings' from /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:91:in `process' from /usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:42:in `run' from ./../config/environment.rb:10 from ./dispatch.cgi:3
I'll be honest, I'm still new to Rails and the error doesn't mean a great deal to me (other than it having decided there's no 'debug_rjs=' method in existence - I'm not using any RJS!). I have a feeling it might be a versioning problem - site5 seem to be running Rails 1.0.0 while I've been developing on 1.1.2 so I've sent them an email to see if it's possible to get 1.1.2. Other than that, I'm pretty much stuffed at this early stage of my Rails experience. If any Rails experts happen to read this and can think of a solution, please let me know! The one thing I do miss from PHP is clear, explanatory error messages at pretty much all times. Yes, it'd sometimes tell you line 34 when the problem was at line 31, but it usually does a very good job of pointing you close enough to the problem and with enough info to quickly track down what's happening. With Rails I get a page just telling me the application failed to start (it's in development mode, not production, so there's no reason not to give more info on what went wrong). Anyway, I still love Rails from a development point of view - I'll just love it more if I can get it to work on a live website! UPDATE: Yup, it needed to be Rails 1.1 - running 'rake freeze_gems' on my local install to dump the rails code in /vendor/rails and then uploading that got it working.

Written by Adam on

Adam is a Director of User Experience by day and photographer as time allows.

You may also like…