Dreamhost: Ruby (Rack) application could not be started-Collection of common programming errors

I have been working on this problem in last two days using [http://jackassofalltrades.org/2012/02/updating-to-a-newer-rails-on-dreamhost][1]/ instruction. I have looked at other ruby on rails and dreamhost issues and instructions, but they seemed out of date. e.g 2010 etc. Moreover, I do aware of heroku which is very easy to deploy but expensive to keep running for my small project. So here are my problems.

  1. Ruby (Rack)application could not be started – a mixture of two Ruby versions: Ruby 1.8 and 1.9 – when visiting to my website via browser.

  2. I am unsure whether the gemset rails_michaelcollins_com remains true when i exit the terminal because every time I log in, the arrow to the particular gemset have been missing from “rvm gemset list”.

  3. Rails console error message stating “Could not find a JavaScript runtime” despite that I have Execjs 1.3.1 according to “bundle show” in rails.michaelcollins.com folder.

Thank you kindly in advance

Error mesage: Ruby (Rack) application could not be started
Application root: /home/miccol2/rails.michaelcollins.com 
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/setup.rb  10  in `exit'
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/setup.rb  10  
/usr/lib/ruby/1.8/rubygems/custom_require.rb    36  in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb    36  in `require'
/home/miccol2/rails.michaelcollins.com/config/boot.rb   6   
/usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `require'
/home/miccol2/rails.michaelcollins.com/config/application.rb    1   
/usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `require'
/home/miccol2/rails.michaelcollins.com/config/environment.rb    2   
/usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb    31  in `require' config.ru  3   
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb 46 in `initialize'
config.ru 1 in `new'
config.ru
[oslo]$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
[oslo]$ which ruby
/home/miccol2/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
[oslo]$ rails -v
Rails 3.2.3
[oslo]$ which rails
/home/miccol2/.rvm/gems/ruby-1.9.3-p194/bin/rails
[oslo]$ rvm -v

rvm 1.13.4 (stable) by Wayne E. Seguin , Michal Papis  [https://rvm.io/]

[oslo]$ rvm gemset list

gemsets for ruby-1.9.3-p194 (found in /home/miccol2/.rvm/gems/ruby-1.9.3-p194)
   global
   rails_michaelcollins_com

[oslo]$ rvm gemset use rails_michaelcollins_com
Using ruby-1.9.3-p194 with gemset rails_michaelcollins_com
[oslo]$ rvm gemset list

gemsets for ruby-1.9.3-p194 (found in /home/miccol2/.rvm/gems/ruby-1.9.3-p194)
   global
=> rails_michaelcollins_com

[oslo]$
[oslo]$ rails console
    /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/execjs-1.3.1/lib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/execjs-1.3.1/lib/execjs.rb:5:in `'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/execjs-1.3.1/lib/execjs.rb:4:in `'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `require'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `each'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:66:in `block in require'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `each'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55:in `require'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.3/lib/bundler.rb:119:in `require'
            from /home/miccol2/rails.michaelcollins.com/config/application.rb:7:in `'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/railties-3.2.3/lib/rails/commands.rb:39:in `require'
            from /home/miccol2/.rvm/gems/ruby-1.9.3-p194@rails_michaelcollins_com/gems/railties-3.2.3/lib/rails/commands.rb:39:in `'
            from script/rails:6:in `require'
            from script/rails:6:in `'
    [oslo]$
[oslo]$ bundle show
Gems included by the bundle:
  * actionmailer (3.2.3)
  * actionpack (3.2.3)
  * activemodel (3.2.3)
  * activerecord (3.2.3)
  * activeresource (3.2.3)
  * activesupport (3.2.3)
  * arel (3.0.2)
  * builder (3.0.0)
  * bundler (1.1.3)
  * coffee-rails (3.2.2)
  * coffee-script (2.2.0)
  * coffee-script-source (1.3.1)
  * erubis (2.7.0)
  * execjs (1.3.1)
  * hike (1.2.1)
  * i18n (0.6.0)
  * journey (1.0.3)
  * jquery-rails (2.0.2)
  * json (1.7.1)
  * mail (2.4.4)
  * mime-types (1.18)
  * multi_json (1.3.4)
  * mysql2 (0.3.11)
  * polyglot (0.3.3)
  * rack (1.4.1)
  * rack-cache (1.2)
  * rack-ssl (1.3.2)
  * rack-test (0.6.1)
  * rails (3.2.3)
  * railties (3.2.3)
  * rake (0.9.2.2)
  * rdoc (3.12)
  * sass (3.1.17)
  * sass-rails (3.2.5)
  * sprockets (2.1.3)
  * thor (0.14.6)
  * tilt (1.3.3)
  * treetop (1.4.10)
  * tzinfo (0.3.33)
  * uglifier (1.2.4)
[oslo]$
  1. You’ve bundled execjs but it can’t find a Javascript runtime, like, say, node.js.

    If you truly need execjs, then install node.js.

    Also, be sure that your PATH environment variable includes the path to your Javascript runtime installation before starting up Rails.

  2. It looks like execjs can’t find it a runtime JS server.

    See this for morre information:

    https://github.com/sstephenson/execjs
    

    Do you need that gem? If so, you’ll need to install a runtime JS server. One widely used one is https://github.com/cowboyd/therubyracer .

    To install that runtime JS server, add this line to your Gemfile:

    gem "therubyracer", :require => 'v8'