1

I'm having trouble running sinatra server.

I installed RVM and wrote a simple sinatra app, sources below. I created public + tmp + tmp/restart.txt folders as well. I followed some answers here/articles on how to set the GEM_PATH/GEM_HOME.

The site is defined with "Passenger (Ruby/Python apps only)" option.

If I run the standalone passenger, with the command line in SSH, it works fine on port 3000 (with public URL, e.g. http://domain.com:3000). So it means the site is fine, gems are available, it's just the connection to Passenger that fails.

I can't even see the logs from apache to see what's wrong. The /home/user/domain.com/http/error.log is empty, and the access.log is filled with 500s. The error in the browser is 500, Internal Server Error, without any clue.

The user I installed RVM to is a full admin on this account.

What am I missing?

# config.ru

# I made sure the path is correct and that all the gems I need are installed there
ENV['GEM_PATH'] = '/home/<MY USERNAME>/.rvm/gems/ruby-1.9.3-p362'
# I tried also setting GEM_HOME instead and with GEM_PATH

require 'rubygems'

Gem.clear_paths

require 'sinatra'

require File.expand_path('../server.rb', __FILE__)
run Sinatra::Application

# server.rb

require 'sinatra'
get '/' do
  "Worked on dreamhost"
end

get '/foo/:bar' do
  "You asked for foo/#{params[:bar]}"
end
elado
  • 8,510
  • 9
  • 51
  • 60
  • Just a small tip. I bet there, on DreamHost, is a control panel somewhere and there you can find an access to error log. – Yevgeniy Anfilofyev Jan 23 '13 at 06:19
  • The only log mentioned there is the directory I mentioned which has an empty error.log. – elado Jan 23 '13 at 08:33
  • 1
    There is possible answer: `The reason is that Passenger Phusion is tied to the version of Ruby installed in /usr/lib, which you can't change without root access. Even though you can install any version of Ruby with RVM, you won't get Passenger to talk to it and therefore your rails project won't use its gems.` Even though it is for BlueHost, I think it's true for DreamHost. [http://stackoverflow.com/questions/12627313/rails-bluehost-error-ruby-rack-application-could-not-be-started](http://stackoverflow.com/questions/12627313/rails-bluehost-error-ruby-rack-application-could-not-be-started) – Yevgeniy Anfilofyev Jan 23 '13 at 12:05

1 Answers1

1

I'm sorry to hear you are having troubles installing RVM onto our servers. This can get kind of tricky sometimes, and know you're not alone! We actually have a whole article on our wiki page dedicated to installing RVM on our servers.

http://wiki.dreamhost.com/Rvm

This should offer some insight on the problem you're experiencing. If you are unable to resolve it, you can also send a ticket over to our technical suport. https://panel.dreamhost.com/index.cgi?tree=support.msg& I hope this all helps!

Regards, Justin H DreamHost Staff

DH_Justin
  • 11
  • 1