At this time the subject is a little misleading as this is yet a tutorial for working with InstantRails and LunarPages. However, I am hoping that with the help of others, we can find a final solution to getting a rails application up and running on the LunarPages server.

Here is where I am at so far:

I have the application running perfectly fine on my local host with InstantRails.

I have requested LunarPages to move my site to a Ruby on Rails server.

I copied all the files from my working rails application to the generate jr directory on my server (via FTP)

I created the necessary database, and migrated any data that was necessary.

With all that said, the application will not run. I point to the www.domain.com/jr/home (which is the correct path when running locally) and I recieve a 404 error. If I point to www.domain.com/jr/index.html, then I get the standard welcome to ruby homepage, but when I click on the "About your application’s environment" link, it shows another 404 error. I have obviously done something wrong.

Once I have this all figured out I will create one last post with beginning to end instructions on how to get a ruby application running.

# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like:# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impairedrequire "dispatcher"

Though I recently just switched to LunarPages and have been thrilled with their support thus far, but I can't help but getting frustrated when it comes to getting this Ruby application up. The number of views to this thread should indicate something. I'm going to press on, but also look for additional Ruby hosts in the background.

Okay, well the support we always expect of LunarPages finally came through. Ends up, my files had ^M characters for new lines (stupid Windows) which are not valid on Unix Ruby servers. I took them out and I have since made some progress.

I attempted to run the usual cron to test the site.

Code:

cd /home/jerem19/jr/public && ./dispatch.fcgi

Missing the Rails 2.0.2 gem. Please `gem install -v=2.0.2 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.

Okay, that's easy enough. So I tried to update it, and as I would have expected, the server was locked down. So I grabbed the current version on the server.

Code:

/usr/local/bin/rails -v

Rails 2.0.1

Okay, I figure a .0.1 difference in versions is not a big deal. I make the necessary update to config/environment.rb.

Code:

Snippet from config/environment.rb------------------------------------------------------------------------------

# Uncomment below to force Rails into production mode when# you don't control web/app server and can't set it the proper wayENV['RAILS_ENV'] ||= 'production'

# Specifies gem version of Rails to use when vendor/rails is not present#RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSIONRAILS_GEM_VERSION = '2.0.1' unless defined? RAILS_GEM_VERSION

Well, I finally got my ruby application (www.jeremyrambo.com) running. At the end of the previous post I was still attempting to run the application using the FastCGI. After reading several other forums I thought I would go for the easier CGI for the time being.

I continued to get a 404 Not Found error. I was frustrated, but also sure that it was on my end, so I dove into the problem head on; determined to resolve this issue and get my application up and running.

It ends up, that I had to add a single line to config/routes.rb.

Code:

map.root :controller => "home"

In this case, "home" was my application root, I could have set this to "blogs" or "albums" if I preferred.

You would not believe the relief I felt when the page first loaded up. I have since made many bugs fixes, add DB columns, etc...all on the server. I never run local anymore.

I hope that this forum will help people. I will be checking in on occasion to hopefully answer questions people may have.

Until then...good luck and happy rubying...

Jeremy Rambo

P.S. I'm going to continue to try getting this site up in FastCGI, if I have any luck I will post the instructions.

It sounds like you are one of the few who were able to get a complete app working, including talking to a DB. Would you be willing to share the full code so others could use it as a quickstart? It would be super helpful.

I'd be willing to merge it all together into a readable format if you don't have time. I've been searching far and wide to see how to get RoR up and running.

There are a lot of components here, creating the .htaccess stuff, the general code for controller/view/model, directory structure, creating the DB to link to rails, etc.

lately just moved to LunarPages and have been excited with their assistance thus far, but I can't help but getting disappointed when it comes to getting this Dark red program up. The variety of opinions to this place should indicate something. I'm going to media on, but also look for extra Dark red serves in the qualifications.