I have Passenger-Enterprise installed on a production server so I can have access to passenger-irb. I am following the instructions found on this documentation here Passenger with Nginx Debugger
Here is the contents of my Gemfile:
source 'https://rubygems.org'
gem 'activeadmin', '1.0.0'
gem 'airbrake', '~> 5.5'
gem 'aws-sdk', '< 2.0' # paperclip doesn't work with the new aws-sdk gem
gem 'redcarpet'
gem 'brakeman'
gem 'byebug', platforms: :ruby_20
gem 'bundler-audit'
gem 'coffee-rails'
As you can see, I have byebug correctly installed. The problems begin when I follow the next step.
In my /etc/nginx/nginx.conf file, I place the passenger_debbuger on; option.
restarting nginx/passenger with this option on immediately kills all passenger processes. When I inspect the error.log file, I see the following error:
[ E 2017-10-20 16:20:20.3577 31875/Tr
age/Cor/App/Implementation.cpp:289 ]: Could not spawn process for application /var/local/openhub/current: An error occurred while starting up the preloader.
9 Error ID: 34c68141
10 Error details saved to: /tmp/passenger-error-CXx53h.html
11 Message from application: cannot load such file -- byebug (LoadError)
12 /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:346:in `require'
13 /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:346:in `load_byebug_gem'
14 /usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:326:in `before_loading_app_code_step2'
15 /usr/share/passenger-enterprise/helper-scripts/rack-preloader.rb:85:in `preload_app'
16 /usr/share/passenger-enterprise/helper-scripts/rack-preloader.rb:140:in `<module:App>'
17 /usr/share/passenger-enterprise/helper-scripts/rack-preloader.rb:14:in `<module:PhusionPassenger>'
18 /usr/share/passenger-enterprise/helper-scripts/rack-preloader.rb:13:in `<main>'
I'm at a loss as to what to try to do at this point. Passenger does not have any documentation anywhere as to how to troubleshoot. I've followed the directions exactly but the passenger_debugger option is not working properly. Has anyone had this problem?
Related
Similar question on SO, but dealing with rails 5. This instance: Rails 6.0.3 with VPS in development.
Running
RAILS_ENV=development bundle exec rails assets:precompile
on the server, or cap development deploylocally to deploy lead to the fact that listen appears to be hidden from vue.
Server:
RAILS_ENV=development bundle exec rails assets:precompile
rails aborted!
LoadError: Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile
local deploying:
01 rake aborted!
01 LoadError: Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile
01 /home/deploy/zappa/shared/bundle/ruby/2.6.0/gems/bootsnap-1.5.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
01 /home/deploy/zappa/shared/bundle/ruby/2.6.0/gems/bootsnap-1.5.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
...
01 Caused by:
01 LoadError: cannot load such file -- listen
but here's the thing:
group :development do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.4'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
Commenting out the gem from the Gemfile predictably fails; I assume rails wants to know about changes and only act upon those.
Running RAILS_ENV=development bundle install returns a clue:
Gems in the groups development and test were not installed.
So how does one go about making listen gem visible?
Moving the gem call out of the development block and into the global block allows RAILS_ENV=development bundle install to run on the remote server. Now the listen gem is installed and the deployment can proceed with compilation. this is a hack, as listen is meant only for development mode; see answer below
the most direct way to overcome the issue is by adding
set :bundle_without, %w{test}.join(':')
to the deploy/development.rb configuration file as per the capistrano instructions.
The default setting is:
set :bundle_without, %w{development test}.join(':')
which is counter-intuitive for development environment.
The error message is also misleading:
LoadError: Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile
Issue: I am having issues deploying app to AWS EB and every remedy I have found on SO and google have not helped my situation.
I installed the AWS EB command line and looking to deploy an app I have built to there but i keep getting this error after attempts to resolve it:
ERROR [Instance: i-065ec77b2c530362b] Command failed on instance. Return code: 18 Output: (TRUNCATED)...g: the running version of Bundler (1.16.2) is older than the version that created the lockfile (1.17.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Your Ruby version is 2.5.3, but your Gemfile specified 2.5.1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2018-12-21 08:51:28 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
The app was initially built with 2.5.1 but I switched it to 2.5.3 today so I can put it onto AWS. (I have both of these ruby versions with rbenv)
I have done:
Set ruby '2.5.3' in Gemfile
bundle update
bundle install
gem install bundler
gem update bundler
deleted gem lock file and bundle updated
./bin/spring stop (spring not running)
ruby -v is ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
(this is local only, I have rbenv global set to 2.5.1, but I don't believe this is an issue as the error states i's the gemfile)
I have done rbenv rehash after updating or installing bundle
bundle update --ruby
Gemfile.lock shows 2.5.3
bundle env shows:
RUBY VERSION
ruby 2.5.3p105
BUNDLED WITH
1.17.2
```
My entire Gemfile - just in case this may help for something:
gem 'dotenv-rails', groups: [:development, :test]
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.3'
gem 'rails', '~> 5.2.1'
gem 'stripe'
gem 'stripe_event'
gem 'pry'
# Use sqlite3 as the database for Active Record
# gem 'sqlite3'
gem 'pg'
gem 'puma', '~> 3.11'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem "chartkick"
gem 'coffee-rails', '~> 4.2'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
# gem 'redis', '~> 4.0'
gem 'api-pagination', '~> 4.1', '>= 4.1.1'
gem 'will_paginate', '~> 3.1', '>= 3.1.6'
gem 'groupdate'
gem 'blazer'
gem 'ahoy_matey'
gem 'devise'
gem 'cancancan', '~> 2.0'
gem 'carrierwave', '~> 1.0'
gem 'carrierwave-aws'
gem 'carrierwave-ffmpeg'
gem 'carrierwave-video'
gem 'bootstrap', '~> 4.1.3'
gem 'sprockets-rails', :require => 'sprockets/railtie'
gem 'sprockets'
gem 'jquery-rails'
gem 'mini_magick', '~> 4.8'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false
group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end
group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
group :test do
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
gem 'chromedriver-helper'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
More info:
rbenv local: 2.5.3
rbenv global: 2.5.1
bundle exec which ruby: /home/bob/.rbenv/versions/2.5.3/bin/ruby
rbenv versions:
system
2.5.1
2.5.3 (set by /home/bob/Apps/uploader-master-side-3/.ruby-version)
bundler -v: Bundler version 1.17.2
bundle platform --ruby: ruby 2.5.3p105
which ruby: /home/bob/.rbenv/shims/ruby
rails c:
Running via Spring preloader in process 5437
Loading development environment (Rails 5.2.2)
irb(main):001:0>
which gem: /home/bob/.rbenv/shims/gem
rbenv which gem: /home/bob/.rbenv/versions/2.5.3/bin/gem
which -a gem:
/home/bob/.rbenv/shims/gem
/usr/bin/gem
rbenv which bundle: /home/bob/.rbenv/versions/2.5.3/bin/bundle
echo $PATH: /home/bob/.rbenv/plugins/ruby-build/bin:/home/bob/.rbenv/shims:/home/bob/.rbenv/bin:/home/bob/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
ruby-build --version: ruby-build 20181106-14-g1ec9abd
When I run server:
=> Booting Puma
=> Rails 5.2.2 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.5.3-p105), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
Thank you for your time and reading this and your help!!!
NAIL IN THE COFFIN:
I just took the copy of my app i created before updating to the new ruby and tried to deploy it and got this:
Your Ruby version is 2.5.3, but your Gemfile specified 2.5.1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2018-12-21 11:04:39 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
.....this is which 2.5.1 set globally and locally
What other options do I have? Delete and re install rbenv? Make a new app and copy everything over except the gemfile? I'm out of options and ideas it seems like
UPDATE:
I had no clue that AWS EB was based off my git commits and i never updated them before trying... ( wow ) and now i don't receive the ruby version error...
So now i don't get the version error but I do get this error:
2018-12-21 22:50:56 ERROR [Instance: i-00ae954ad2b716b2a] Command failed on instance. Return code: 1 Output: (TRUNCATED)...lizers/carrierwave.rb:1:in `<main>'
/var/app/ondeck/config/environment.rb:5:in `<main>'
/opt/rubies/ruby-2.5.3/bin/bundle:23:in `load'
/opt/rubies/ruby-2.5.3/bin/bundle:23:in `<main>'
Tasks: TOP => environment
(See full trace by running task with --trace).
Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2018-12-21 22:50:56 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2018-12-21 22:51:58 ERROR Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
Since this error is different from the original question, I have created a new one here: Deploying with AWWS EB but with erors
I was having this problem after upgrading the platform from Ruby 3.0 Amazon Linux 2/3.4.4 to Ruby 3.0 Amazon Linux 2/3.4.6, which upgrades Ruby 3.0.3 -> 3.0.4
I was using eb cli to deploy with, eb deploy, but what solve the issue was deploying via uploading a zip file directly in AWS Elastic Beanstalk console, in Elastic Beanstalk > Applications > your-app > Application versions.
The zip file was generated with git archive -v -o myapp.zip --format=zip HEAD, according to AWS manual.
I am replying here because this was the first SO link on Google, but this was the answer that helped me.
I get the following error on my rails app:
Web application could not be started
cannot load such file -- /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core/lib/union_station_hooks_core (LoadError)
/u/sf/netmon/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/u/sf/netmon/.rbenv/versions/2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/ruby_supportlib/phusion_passenger.rb:235:in `require_passenger_lib'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb:232:in `before_loading_app_code_step1'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/helper-scripts/rack-preloader.rb:99:in `preload_app'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/helper-scripts/rack-preloader.rb:156:in `<module:App>'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/helper-scripts/rack-preloader.rb:30:in `<module:PhusionPassenger>'
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/helper-scripts/rack-preloader.rb:29:in `<main>'
Error ID
28518bd5
Looking at the file system:
-bash-4.1$ pwd
/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/src/ruby_supportlib/phusion_passenger/vendor/union_station_hooks_core
-bash-4.1$ tree
.
0 directories, 0 files
So obviously there is indeed no such file... how should i fix this?
My Gemfile:
source 'https://rubygems.org'
gem 'rails', git: 'https://github.com/rails/rails', branch: '4-2-stable'
gem 'actionpack-action_caching'
gem 'pg'
gem 'redis'
gem 'rubytree'
gem 'turbolinks'
gem 'jquery-rails'
gem 'jquery-datatables-rails', git: 'https://github.com/rweng/jquery-datatables-rails'
gem 'rails-timeago'
gem 'dygraphs-rails'
gem 'underscore-rails'
gem 'd3_rails'
gem 'twitter-bootstrap-rails', '= 2.2.8'
gem 'less-rails'
gem 'coffee-rails', git: 'https://github.com/rails/coffee-rails'
gem 'coffeebeans'
gem 'jquery-ui-rails'
group :assets do
gem 'sass-rails', git: 'https://github.com/rails/sass-rails', branch: '5-0-stable'
gem 'therubyracer', platforms: :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jbuilder', '~> 1.0.1'
gem 'passenger', git: 'https://github.com/FooBarWidget/passenger', branch: 'stable-5.0'
gem 'rack-webauth'
gem 'bunny'
Installed ruby 2.3.0 via ruby-build and passenger's apache module reported no errors:
$ ./passenger-install-apache2-module
...
Validating installation...
* Checking whether this Passenger install is in PATH... (!)
Please add /opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/passenger-e139c4cd3ebd/bin to PATH.
Otherwise you will get "command not found" errors upon running
any Passenger commands.
Learn more at about PATH at:
https://www.phusionpassenger.com/library/indepth/environment_variables.html#the-path-environment-variable
* Checking whether there are no other Passenger installations... ✓
* Checking whether Apache is installed... ✓
* Checking whether the Passenger module is correctly configured in Apache... ✓
Detected 0 error(s), 1 warning(s).
Press ENTER to continue.
seems like a quick search through the passenger github helped...
union_station_hooks_core and union_station_hooks_rails are both git submodules on the main passenger git repo. so modifying my gemfile to include submodules: true will pull in the required files.
gem 'passenger', \
git: 'https://github.com/FooBarWidget/passenger', \
branch: 'stable-5.0', \
submodules: true
I has same problem. It is because you passenger is not full.
Full passenger will be via make.
just download needed version like this
wget http://s3.amazonaws.com/phusion-passenger/releases/passenger-5.0.26.tar.gz
And extract to /opt/passenger
Then rerun passenger-install-nginx-module and add it to PATH -
echo 'PATH=/opt/passenger/bin:$PATH' >>etc/profile
PATH=/opt/passenger/bin:$PATH
export PATH
passenger-config validate-install
And not forget correct in http section
http {
...
passenger_root /opt/passenger;
passenger_ruby /usr/bin/ruby;
...
}
I'm trying to setup Rails 4.2 on Nginx for a while now. Every time I start a fresh install with RVM it gets fine. I can run rake db:create:all and create the databases. But if I restart Nginx using /etc/init.d/nginx restart, Passenger sends me an error about a gem :
It looks like Bundler could not find a gem. Maybe you didn't install all the gems that this application needs. To install your gems, please run:
bundle install
If that didn't work, then the problem is probably caused by your application being run under a different environment than it's supposed to. Please check the following:
Is this app supposed to be run as the www-data user?
Is this app being run on the correct Ruby interpreter? Below you will see which Ruby interpreter Phusion Passenger attempted to use.
-------- The exception is as follows: -------
Could not find pg-0.18.3 in any of the sources (Bundler::GemNotFound)
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/spec_set.rb:92:in `block in materialize'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/spec_set.rb:85:in `map!'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/spec_set.rb:85:in `materialize'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/definition.rb:140:in `specs'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/definition.rb:185:in `specs_for'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/definition.rb:174:in `requested_specs'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/environment.rb:18:in `requested_specs'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/runtime.rb:13:in `setup'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler.rb:127:in `setup'
/var/lib/gems/2.1.0/gems/bundler-1.10.6/lib/bundler/setup.rb:18:in `<top (required)>'
/usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:411:in `activate_gem'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:295:in `block in run_load_path_setup_code'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:416:in `running_bundler'
/usr/lib/ruby/vendor_ruby/phusion_passenger/loader_shared_helpers.rb:294:in `run_load_path_setup_code'
/usr/share/passenger/helper-scripts/rack-preloader.rb:99:in `preload_app'
/usr/share/passenger/helper-scripts/rack-preloader.rb:153:in `<module:App>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/share/passenger/helper-scripts/rack-preloader.rb:28:in `<main>'
The pg gem is already installed in my Gemfile and in RVM :
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4'
gem 'pg', '~> 0.18.3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'therubyracer', platforms: :ruby
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
gem 'execjs'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end
Then if I run gem query --local I get pg (0.18.3)
config/database.yml :
login: &login
adapter: postgresql
username: myuser
password: mypass
host: localhost
encoding: UTF8
development:
<<: *login
database: mydb_dev
test:
<<: *login
database: mydb_test
production:
<<: *login
database: mydb_prod
rvm info :
ruby:
interpreter: "ruby"
version: "2.2.1p85"
date: "2015-02-26"
platform: "x86_64-linux"
patchlevel: "2015-02-26 revision 49769"
full_version: "ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]"
homes:
gem: "/usr/local/rvm/gems/ruby-2.2.1"
ruby: "/usr/local/rvm/rubies/ruby-2.2.1"
binaries:
ruby: "/usr/local/rvm/rubies/ruby-2.2.1/bin/ruby"
irb: "/usr/local/rvm/rubies/ruby-2.2.1/bin/irb"
gem: "/usr/local/rvm/rubies/ruby-2.2.1/bin/gem"
rake: "/usr/local/rvm/rubies/ruby-2.2.1/bin/rake"
environment:
PATH: "/usr/local/rvm/gems/ruby-2.2.1/bin:/usr/local/rvm/gems/ruby-2.2.1#global/bin:/usr/local/rvm/rubies/ruby-2.2.1/bin:/usr/local/rvm/bin:/root/.composer/vendor/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
GEM_HOME: "/usr/local/rvm/gems/ruby-2.2.1"
GEM_PATH: "/usr/local/rvm/gems/ruby-2.2.1:/usr/local/rvm/gems/ruby-2.2.1#global"
MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-2.2.1"
IRBRC: "/usr/local/rvm/rubies/ruby-2.2.1/.irbrc"
RUBYOPT: ""
Am I doing something wrong when I try to restart Nginx ?
You seem to have the gem installed, but your bundler isn't finding it when you restart.
A few ideas:
have you performed a bundle in your gemfile directory? Try running bundle exec gem list to see what's actually in your bundle, and not just what's installed locally (which is what you see with gem query --local).
check that you have a default version of ruby set by rvm that matches what's being bundled with. It's possible that, when you restart, it's defaulting to the wrong Ruby version (and then looking in the wrong path)
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
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.