Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
November 28, 2014, 02:43:53 PM

Pages: [1]   Go Down
  Print  
Author Topic: InstantRails & LunarPages together as one  (Read 56577 times)
JeremyRambo
Space Explorer
***
Offline Offline

Posts: 6


WWW
« on: March 14, 2008, 02:24:31 PM »

Hello everyone,

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.
  • LunarPages successfully move my account to the new server.
    • I have subsequently renamed my name servers to the new server.
    • LunarPages successfully generated my RoR application folder (I chose "jr")
    • LunarPages create the required soft link to ../account/jr
  • 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.

Please help!

Thanks in advance...
Logged
JeremyRambo
Space Explorer
***
Offline Offline

Posts: 6


WWW
« Reply #1 on: March 16, 2008, 08:11:16 AM »

Okay, after gleaning many more posts in the forum I decided to run the dispatch.cgi via a cron job to check my output.

Cron command:
Code:
cd /home/jerem19/jr/public && ./dispatch.cgi

Cron result:
Code:
/bin/sh: ./dispatch.cgi: /usr/local/bin/ruby
: bad interpreter: No such file or directory

Dispatch CGI:
Code:
#!/usr/local/bin/ruby

require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)

# 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 impaired
require "dispatcher"

ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
Dispatcher.dispatch

My site is sitting on the tyro server, any ideas?
« Last Edit: March 16, 2008, 08:12:54 AM by JeremyRambo » Logged
JeremyRambo
Space Explorer
***
Offline Offline

Posts: 6


WWW
« Reply #2 on: March 21, 2008, 05:00:13 AM »

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. 
« Last Edit: March 21, 2008, 05:08:34 AM by JeremyRambo » Logged
JeremyRambo
Space Explorer
***
Offline Offline

Posts: 6


WWW
« Reply #3 on: March 21, 2008, 05:05:00 AM »

I have still had no luck.  Thinking about giving up soon.  Read good reviews on a couple of other hosts.
« Last Edit: March 21, 2008, 05:22:51 AM by JeremyRambo » Logged
JeremyRambo
Space Explorer
***
Offline Offline

Posts: 6


WWW
« Reply #4 on: March 27, 2008, 02:07:37 PM »

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 way
ENV['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_VERSION
RAILS_GEM_VERSION = '2.0.1' unless defined? RAILS_GEM_VERSION

Let's try to re-run the dispatch.fcgi
Code:
cd /home/jerem19/jr/public && ./dispatch.fcgi

./dispatch.fcgi:27:Warning: require_gem is obsolete.  Use gem instead.
Content-Type: text/html; charset=utf-8
Set-Cookie: _jr_session_id=XXX path=/
Status: 404 Not Found
Cache-Control: no-cache
Content-Length: 947

Alright, simple enough error...fixed this then tried again.
Code:
cd /home/jerem19/jr/public && ./dispatch.fcgi

Content-Type: text/html; charset=utf-8
Set-Cookie: _jr_session_id=XXX path=/
Status: 404 Not Found
Cache-Control: no-cache
Content-Length: 947

Going to continue trying...will keep posting.
« Last Edit: March 27, 2008, 02:10:58 PM by JeremyRambo » Logged
JeremyRambo
Space Explorer
***
Offline Offline

Posts: 6


WWW
« Reply #5 on: March 31, 2008, 07:15:01 AM »

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.
Logged
Olav2
Newbie
*
Offline Offline

Posts: 4


« Reply #6 on: September 29, 2010, 09:19:09 AM »

Jeremy-

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.

Let me know if I can be of some help or generate the docs for you.

Logged
pulseclinic
Newbie
*
Offline Offline

Posts: 1


« Reply #7 on: March 18, 2012, 08:57:40 PM »

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. 

Rosacea Treatment
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: