我正在尝试在我的应用程序上运行工头启动。
但它给了我一个错误说
12:53:39 web.1 | started with pid 7647
12:53:39 rails.1 | started with pid 7648
12:53:39 webpack.1 | started with pid 7649
12:53:39 web.1 | [passenger_native_support.bundle] trying to compile for the current user (hiro_yamada) and Ruby interpreter...
12:53:39 web.1 | (set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable)
12:53:40 webpack.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bundler/gems/webpacker-78b2dd910603/lib/webpacker/dev_server_runner.rb:47:in `exec': No such file or directory - /Users/hiro_yamada/Dropbox/foriio/node_modules/.bin/webpack-dev-server (Errno::ENOENT)
12:53:40 webpack.1 | from /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bundler/gems/webpacker-78b2dd910603/lib/webpacker/dev_server_runner.rb:47:in `block in execute_cmd'
12:53:40 webpack.1 | from /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bundler/gems/webpacker-78b2dd910603/lib/webpacker/dev_server_runner.rb:46:in `chdir'
12:53:40 webpack.1 | from /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bundler/gems/webpacker-78b2dd910603/lib/webpacker/dev_server_runner.rb:46:in `execute_cmd'
12:53:40 webpack.1 | from /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bundler/gems/webpacker-78b2dd910603/lib/webpacker/dev_server_runner.rb:11:in `run'
12:53:40 webpack.1 | from /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bundler/gems/webpacker-78b2dd910603/lib/webpacker/runner.rb:6:in `run'
12:53:40 webpack.1 | from /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bundler/gems/webpacker-78b2dd910603/exe/webpack-dev-server:8:in `<top (required)>'
12:53:40 webpack.1 | from bin/webpack-dev-server:17:in `load'
12:53:40 webpack.1 | from bin/webpack-dev-server:17:in `<main>'
12:53:40 webpack.1 | exited with code 1
12:53:40 system | sending SIGTERM to all processes
12:53:40 web.1 | bundler: failed to load command: passenger (/Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bin/passenger)
12:53:40 web.1 | SignalException: SIGTERM
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:310:in `system'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:310:in `sh_nonfatal'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:337:in `block (3 levels) in compile'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:335:in `chdir'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:335:in `block (2 levels) in compile'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/utils/tmpio.rb:70:in `mktmpdir'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:334:in `block in compile'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:378:in `block (2 levels) in try_directories'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:377:in `chdir'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:377:in `block in try_directories'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:371:in `each'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:371:in `each_with_index'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:371:in `try_directories'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:329:in `compile'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:219:in `compile_and_load'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:52:in `start'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/native_support.rb:439:in `<top (required)>'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger.rb:240:in `require'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger.rb:240:in `require_passenger_lib'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/utils/file_system_watcher.rb:25:in `<top (required)>'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger.rb:240:in `require'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger.rb:240:in `require_passenger_lib'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb:27:in `<top (required)>'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger.rb:240:in `require'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger.rb:240:in `require_passenger_lib'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb:288:in `find_apps'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb:59:in `run'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/src/ruby_supportlib/phusion_passenger/standalone/main.rb:51:in `run!'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/gems/passenger-5.1.8/bin/passenger:45:in `<top (required)>'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bin/passenger:23:in `load'
12:53:40 web.1 | /Users/hiro_yamada/Dropbox/foriio/vendor/bundle/ruby/2.2.0/bin/passenger:23:in `<top (required)>'
12:53:40 rails.1 | terminated by SIGTERM
12:53:40 web.1 | exited with code 1
我该如何解决这个问题...?谢谢你的时间。
所以我尝试在宝石文件和捆绑上添加乘客......仍然不工作。我注意到一件事,当我将我的 ruby 版本更改为 2.2.0 时,sinc 乘客在目录 ruby/2.2.0/下。然后返回错误,说工头只能在 2.2.3 上运行。也许我安装的乘客宝石与 ruby 2.2.3 不兼容??
我的文件和宝石文件是
web: bundle exec passenger start -p $PORT --max-pool-size 6
rails: PORT=3000 rails s
webpack: bin/webpack-dev-server
source 'https://rubygems.org'
ruby "2.2.3"
gem 'rails', '~> 5.1.1'
gem 'uglifier', '>= 1.3.0'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'spring', group: :development
gem 'passenger'
gem 'paperclip', '4.3.6'
gem 'rmagick'
gem 'aws-sdk', '< 2.0'
gem 'newrelic_rpm'
gem 'friendly_id', '~> 5.1.0'
gem 'ruby-oembed'
gem 'impressionist'
gem 'meta-tags'
gem 'capybara'
gem 'poltergeist'
gem 'webpacker', github: 'rails/webpacker'
# Client
gem 'slim-rails'
gem 'sass-rails'
gem 'coffee-rails'
gem 'jquery-rails'
gem 'jquery-ui-rails'
gem 'turbolinks'
gem 'aasm'
gem 'siteinfo_parser'
gem 'open_uri_redirections'
# Exception Notification to Slack
gem 'exception_notification', :github => 'smartinez87/exception_notification'
gem 'slack-notifier'
# login
gem 'devise'
# Oauth
gem 'omniauth'
gem 'omniauth-facebook'
gem 'omniauth-twitter'
gem 'omniauth-instagram'
# Auth
gem 'cancancan', '~> 1.10'
# SNS API
gem 'koala'
gem 'twitter'
gem 'instagram'
# manage constant file
gem 'config'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# Pagination
gem 'kaminari'
# Auto-link
gem 'rails_autolink'
#font-awesome
gem 'font-awesome-sass'
# follow, like, mention
gem 'socialization'
# Copy to clipboard
gem 'zeroclipboard-rails'
group :development, :test do
gem 'better_errors'
gem 'binding_of_caller'
gem 'foreman'
gem 'pry-rails'
gem 'pry-byebug'
gem 'pry-doc'
gem 'pry-stack_explorer'
end
group :development do
gem 'pg'
end
group :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
gem 'rails_12factor'
end
乘客有问题。尝试仅在开发模式下运行它,然后在生产中运行它。您应该会在日志输出中看到错误。
这是调试工头的最常见方法。
尝试将gem 'passenger'
添加到 Gemfile 并运行 bundle
。问题可能是您通过gem install passenger
安装了乘客,而捆绑器没有加载它。