0
votes

First of all, I am a programming newbie and even more recent Ruby/Rails newbie. I have a site that I am trying to upload (http://suzyogi.com). Most of the pages are just HTML and CSS with a bit of jQuery, but I wanted to include a blog, so I built it in Rails 4.2.0. I am using DreamHost to host my site, and their instructions for Rails apps told me to check this option under Web Options: Passenger(Ruby/Python apps only). Everything works fine on my local environment, but when I try to view the site on the internet I get this error from Phusion Passenger:

compile error
/home/nictob3/suzyogi.com/Gemfile:24: syntax error, unexpected ':', expecting $end
gem 'sdoc', '~> 0.4.0', group: :doc
                          ^ (SyntaxError)
/home/nictob3/suzyogi.com/Gemfile:24:in `evaluate'
/usr/lib/ruby/vendor_ruby/bundler/definition.rb:17:in `build'
/usr/lib/ruby/vendor_ruby/bundler.rb:136:in `definition'
/usr/lib/ruby/vendor_ruby/bundler.rb:124:in `load'
/usr/lib/ruby/vendor_ruby/bundler.rb:107:in `setup'
/usr/lib/ruby/vendor_ruby/bundler/setup.rb:17
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/dh/passenger/lib/phusion_passenger/loader_shared_helpers.rb:263:in `run_load_path_setup_code'
/dh/passenger/lib/phusion_passenger/loader_shared_helpers.rb:366:in `running_bundler'
/dh/passenger/lib/phusion_passenger/loader_shared_helpers.rb:261:in `run_load_path_setup_code'
/dh/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
/dh/passenger/helper-scripts/rack-preloader.rb:158

I looked around for a fix and found this possible answer, editing the Gemfile to look like:

group :doc do
  gem 'sdoc', '~> 0.4.0'
end

Now I get a new error:

Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (= 4.2.0) depends on
  bundler (< 2.0, >= 1.3.0)

Current Bundler version:
  bundler (1.0.15)
(Bundler::VersionConflict)
/usr/lib/ruby/vendor_ruby/bundler/resolver.rb:129:in `resolve'
/usr/lib/ruby/vendor_ruby/bundler/resolver.rb:127:in `catch'
/usr/lib/ruby/vendor_ruby/bundler/resolver.rb:127:in `resolve'
/usr/lib/ruby/vendor_ruby/bundler/definition.rb:151:in `resolve'
/usr/lib/ruby/vendor_ruby/bundler/definition.rb:90:in `specs'
/usr/lib/ruby/vendor_ruby/bundler/definition.rb:135:in `specs_for'
/usr/lib/ruby/vendor_ruby/bundler/definition.rb:124:in `requested_specs'
/usr/lib/ruby/vendor_ruby/bundler/environment.rb:23:in `requested_specs'
/usr/lib/ruby/vendor_ruby/bundler/runtime.rb:11:in `setup'
/usr/lib/ruby/vendor_ruby/bundler.rb:107:in `setup'
/usr/lib/ruby/vendor_ruby/bundler/setup.rb:17
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in `require'
/dh/passenger/lib/phusion_passenger/loader_shared_helpers.rb:263:in `run_load_path_setup_code'
/dh/passenger/lib/phusion_passenger/loader_shared_helpers.rb:366:in `running_bundler'
/dh/passenger/lib/phusion_passenger/loader_shared_helpers.rb:261:in `run_load_path_setup_code'
/dh/passenger/helper-scripts/rack-preloader.rb:100:in `preload_app'
/dh/passenger/helper-scripts/rack-preloader.rb:158

However, when I run the command bundler -v in terminal, it returns Bundler version 1.7.12.

So how do I make Passenger recognize that I have this updated Bundler?

Thanks for any help.

My Gemfile:

source 'https://rubygems.org'
gem 'rails', '4.2.0'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'

# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
group :doc do
  gem 'sdoc', '~> 0.4.0'
end

group :development, :test do
  gem 'byebug'
  gem 'web-console', '~> 2.0'
  gem 'spring'
end
1
It looks like it's using a different version of Ruby than you're expecting. Are you using DreamHost shared hosting or VPS?Tim Moore
@TimMoore I am using shared hosting. Does DreamHost only support certain versions of Ruby / Rails?fastasleep

1 Answers

0
votes

According to http://wiki.dreamhost.com/Passenger#A_couple_of_technical_notes only Ruby 1.8.7 is supported on DreamHost shared hosting. That information is dated Aug 18 2011, but from your error messages, this appears to still be the case.

The clues are the "1.8" in paths such as /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb as well as the error syntax error, unexpected ':', expecting $end (because Ruby 1.8 does not support the key: value hash syntax, only :key => value).

According to the wiki page linked above, you'll need to use a private server to install your own Ruby version, but it might also be worth contacting DreamHost support to ask about their plans for upgrading. Ruby 1.8.7 has reached its end of life and is no longer receiving security updates.