3

我已经调试了一天多,没有运气,

安装 ruby​​、gems 和Passenger 后,我尝试启动Passenger,但不断收到“找不到乘客”:

passenger@dragon:/usr/website/myapp/current$ passenger start -p 4000 -e production -d
/home/passenger/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find passenger (>= 0) amongst [actionmailer-3.2.8, actionmailer-3.2.3, actionpack-3.2.8, actionpack-3.2.3, activemodel-3.2.8, activemodel-3.2.3, activerecord-3.2.8, activerecord-3.2.3, activeresource-3.2.8, activeresource-3.2.3, activesupport-3.2.8, activesupport-3.2.3, arel-3.0.2, bcrypt-ruby-3.0.1, builder-3.0.3, builder-3.0.0, cape-1.4.0, capistrano-2.13.4, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.3.3, devise-2.1.2, devise_ldap_authenticatable-0.6.1, erubis-2.7.0, execjs-1.4.0, guess_html_encoding-0.0.4, high_voltage-1.1.1, highline-1.6.15, hike-1.2.1, i18n-0.6.1, i18n-0.6.0, journey-1.0.4, jquery-rails-2.0.2, jruby-pageant-1.1.1, jsmin-1.0.1, json-1.7.3, libv8-3.3.10.4-x86-linux, mail-2.4.4, mime-types-1.19, mini_magick-3.4, multi_json-1.3.6, net-ldap-0.2.2, net-scp-1.0.4, net-sftp-2.0.5, net-ssh-2.6.0, net-ssh-gateway-1.1.0, nokogiri-1.5.5, orm_adapter-0.4.0, 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.8, rails-3.2.3, rails-settings-cached-0.2.1, railties-3.2.8, railties-3.2.3, rake-0.9.2.2, rdoc-3.12, ruby-readability-0.5.4, rvm-capistrano-1.2.7, sass-3.1.20, sass-rails-3.2.5, sprockets-2.1.3, sqlite3-1.3.6, subexec-0.2.2, swfobject-rails-1.1.1, therubyracer-0.10.1, thor-0.16.0, thor-0.14.6, tilt-1.3.3, treetop-1.4.10, tzinfo-0.3.33, uglifier-1.2.5, warden-1.2.1] (Gem::LoadError)
        from /home/passenger/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
        from /home/passenger/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
        from /home/passenger/.rvm/gems/ruby-1.9.3-p194/bin/passenger:18:in `<main>'
        from /home/passenger/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
        from /home/passenger/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

gem install passenger如您所见,在安装了Passenger gem(我曾经安装过它)时:

passenger@dragon:/usr/website/myapp/current$ gem list

*** LOCAL GEMS ***

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)
bcrypt-ruby (3.0.1)
builder (3.0.0)
bundler (1.2.1)
cape (1.4.0)
capistrano (2.13.4)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
daemon_controller (1.0.0)
devise (2.1.2)
devise_ldap_authenticatable (0.6.1)
erubis (2.7.0)
execjs (1.4.0)
fastthread (1.0.7)
file-tail (1.0.11)
guess_html_encoding (0.0.4)
high_voltage (1.1.1)
highline (1.6.15)
hike (1.2.1)
i18n (0.6.0)
journey (1.0.4)
jquery-rails (2.0.2)
jruby-pageant (1.1.1)
jsmin (1.0.1)
json (1.7.3)
libv8 (3.3.10.4 x86-linux)
mail (2.4.4)
mime-types (1.19)
mini_magick (3.4)
multi_json (1.3.6)
net-ldap (0.2.2)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.6.0)
net-ssh-gateway (1.1.0)
nokogiri (1.5.5)
orm_adapter (0.4.0)
passenger (3.0.17)
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)
rails-settings-cached (0.2.1)
railties (3.2.3)
rake (0.9.2.2)
rdoc (3.12)
ruby-readability (0.5.4)
rubygems-bundler (1.1.0)
rvm (1.11.3.5)
rvm-capistrano (1.2.7)
sass (3.1.20)
sass-rails (3.2.5)
sprockets (2.1.3)
sqlite3 (1.3.6)
subexec (0.2.2)
swfobject-rails (1.1.1)
therubyracer (0.10.1)
thor (0.14.6)
tilt (1.3.3)
tins (0.5.5)
treetop (1.4.10)
tzinfo (0.3.33)
uglifier (1.2.5)
warden (1.2.1)

这是我的宝石环境:

passenger@dragon:/usr/website/myapp/current$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.9.3 (2012-04-20 patchlevel 194) [i686-linux]
  - INSTALLATION DIRECTORY: /home/passenger/.rvm/gems/ruby-1.9.3-p194
  - RUBY EXECUTABLE: /home/passenger/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
  - EXECUTABLE DIRECTORY: /home/passenger/.rvm/gems/ruby-1.9.3-p194/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/passenger/.rvm/gems/ruby-1.9.3-p194
     - /home/passenger/.rvm/gems/ruby-1.9.3-p194@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

这是 rvm 信息:

passenger@dragon:/usr/website/myapp/current$ rvm info

ruby-1.9.3-p194:

  system:
    uname:       "Linux dragon 3.2.0-26-generic-pae #41-Ubuntu SMP Thu Jun 14 16:45:14 UTC 2012 i686 i686 i386 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.2.24(1)-release (i686-pc-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.15.9 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    updated:      "2 days 23 hours 20 minutes 14 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p194"
    date:         "2012-04-20"
    platform:     "i686-linux"
    patchlevel:   "2012-04-20 revision 35410"
    full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]"

  homes:
    gem:          "/home/passenger/.rvm/gems/ruby-1.9.3-p194"
    ruby:         "/home/passenger/.rvm/rubies/ruby-1.9.3-p194"

  binaries:
    ruby:         "/home/passenger/.rvm/rubies/ruby-1.9.3-p194/bin/ruby"
    irb:          "/home/passenger/.rvm/rubies/ruby-1.9.3-p194/bin/irb"
    gem:          "/home/passenger/.rvm/rubies/ruby-1.9.3-p194/bin/gem"
    rake:         "/home/passenger/.rvm/gems/ruby-1.9.3-p194@global/bin/rake"

  environment:
    PATH:         "/home/passenger/.rvm/gems/ruby-1.9.3-p194/bin:/home/passenger/.rvm/gems/ruby-1.9.3-p194@global/bin:/home/passenger/.rvm/rubies/ruby-1.9.3-p194/bin:/home/passenger/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
    GEM_HOME:     "/home/passenger/.rvm/gems/ruby-1.9.3-p194"
    GEM_PATH:     "/home/passenger/.rvm/gems/ruby-1.9.3-p194:/home/passenger/.rvm/gems/ruby-1.9.3-p194@global"
    MY_RUBY_HOME: "/home/passenger/.rvm/rubies/ruby-1.9.3-p194"
    IRBRC:        "/home/passenger/.rvm/rubies/ruby-1.9.3-p194/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

这是引发错误的方法(第 247 行):

  1 require "rubygems/requirement"
  2
  3 ##
  4 # The Dependency class holds a Gem name and a Gem::Requirement.
  5
  6 class Gem::Dependency
  7
  8   ##
  9   # Valid dependency types.
 10   #--
 11   # When this list is updated, be sure to change
 12   # Gem::Specification::CURRENT_SPECIFICATION_VERSION as well.
 13
 14   TYPES = [
 15            :development,
 16            :runtime,
 17           ]
 18
 19   ##
 20   # Dependency name or regular expression.
 21
 22   attr_accessor :name
 23
 24   ##
 25   # Allows you to force this dependency to be a prerelease.
 26
 27   attr_writer :prerelease
 28
 29   ##
 30   # Constructs a dependency with +name+ and +requirements+. The last
 31   # argument can optionally be the dependency type, which defaults to
 32   # <tt>:runtime</tt>.
 33
 34   def initialize name, *requirements
 35     if Regexp === name then
 36       msg = ["NOTE: Dependency.new w/ a regexp is deprecated.",
 37              "Dependency.new called from #{Gem.location_of_caller.join(":")}"]
 38       warn msg.join("\n") unless Gem::Deprecate.skip
 39     end
 40
 41     type         = Symbol === requirements.last ? requirements.pop : :runtime
 42     requirements = requirements.first if 1 == requirements.length # unpack
 43
 44     unless TYPES.include? type
 45       raise ArgumentError, "Valid types are #{TYPES.inspect}, "
 46         + "not #{type.inspect}"
 47     end
 48
 49     @name        = name
 50     @requirement = Gem::Requirement.create requirements
 51     @type        = type
 52     @prerelease  = false
 53
 54     # This is for Marshal backwards compatibility. See the comments in
 55     # +requirement+ for the dirty details.
 56
 57     @version_requirements = @requirement
 58   end
 59
 60   ##
 61   # A dependency's hash is the XOR of the hashes of +name+, +type+,
 62   # and +requirement+.
 63
 64   def hash # :nodoc:
 65     name.hash ^ type.hash ^ requirement.hash
 66   end
 67
 68   def inspect # :nodoc:
 69     "<%s type=%p name=%p requirements=%p>" %
 70       [self.class, self.type, self.name, requirement.to_s]
 71   end
 72
 73   ##
 74   # Does this dependency require a prerelease?
 75
 76   def prerelease?
 77     @prerelease || requirement.prerelease?
 78   end
 79
 80   def pretty_print q # :nodoc:
 81     q.group 1, 'Gem::Dependency.new(', ')' do
 82       q.pp name
 83       q.text ','
 84       q.breakable
 85
 86       q.pp requirement
 87
 88       q.text ','
 89       q.breakable
 90
 91       q.pp type
 92     end
 93   end
 94
 95   ##
 96   # What does this dependency require?
 97
 98   def requirement
 99     return @requirement if defined?(@requirement) and @requirement
100
101     # @version_requirements and @version_requirement are legacy ivar
102     # names, and supported here because older gems need to keep
103     # working and Dependency doesn't implement marshal_dump and
104     # marshal_load. In a happier world, this would be an
105     # attr_accessor. The horrifying instance_variable_get you see
106     # below is also the legacy of some old restructurings.
107     #
108     # Note also that because of backwards compatibility (loading new
109     # gems in an old RubyGems installation), we can't add explicit
110     # marshaling to this class until we want to make a big
111     # break. Maybe 2.0.
112     #
113     # Children, define explicit marshal and unmarshal behavior for
114     # public classes. Marshal formats are part of your public API.
115
116     if defined?(@version_requirement) && @version_requirement
117       version = @version_requirement.instance_variable_get :@version
118       @version_requirement  = nil
119       @version_requirements = Gem::Requirement.new version
120     end
121
122     @requirement = @version_requirements if defined?(@version_requirements)
123   end
124
125   def requirements_list
126     requirement.as_list
127   end
128
129   def to_s # :nodoc:
130     if type != :runtime then
131       "#{name} (#{requirement}, #{type})"
132     else
133       "#{name} (#{requirement})"
134     end
135   end
136
137   ##
138   # Dependency type.
139
140   def type
141     @type ||= :runtime
142   end
143
144   def == other # :nodoc:
145     Gem::Dependency === other &&
146       self.name        == other.name &&
147       self.type        == other.type &&
148       self.requirement == other.requirement
149   end
150
151   ##
152   # Dependencies are ordered by name.
153
154   def <=> other
155     self.name <=> other.name
156   end
157
158   ##
159   # Uses this dependency as a pattern to compare to +other+. This
160   # dependency will match if the name matches the other's name, and
161   # other has only an equal version requirement that satisfies this
162   # dependency.
163
164   def =~ other
165     unless Gem::Dependency === other
166       return unless other.respond_to?(:name) && other.respond_to?(:version)
167       other = Gem::Dependency.new other.name, other.version
168     end
169
170     return false unless name === other.name
171
172     reqs = other.requirement.requirements
173
174     return false unless reqs.length == 1
175     return false unless reqs.first.first == '='
176
177     version = reqs.first.last
178
179     requirement.satisfied_by? version
180   end
181
182   def match? name, version
183     return false unless self.name === name
184     return true if requirement.none?
185
186     requirement.satisfied_by? Gem::Version.new(version)
187   end
188
189   def matches_spec? spec
190     return false unless name === spec.name
191     return true  if requirement.none?
192
193     requirement.satisfied_by?(spec.version)
194   end
195
196   ##
197   # Merges the requirements of +other+ into this dependency
198
199   def merge other
200     unless name == other.name then
201       raise ArgumentError,
202             "#{self} and #{other} have different names"
203     end
204
205     default = Gem::Requirement.default
206     self_req  = self.requirement
207     other_req = other.requirement
208
209     return self.class.new name, self_req  if other_req == default
210     return self.class.new name, other_req if self_req  == default
211
212     self.class.new name, self_req.as_list.concat(other_req.as_list)
213   end
214
215   def matching_specs platform_only = false
216     matches = Gem::Specification.find_all { |spec|
217       self.name === spec.name and # TODO: == instead of ===
218         requirement.satisfied_by? spec.version
219     }
220
221     if platform_only
222       matches.reject! { |spec|
223         not Gem::Platform.match spec.platform
224       }
225     end
226
227     matches = matches.sort_by { |s| s.sort_obj } # HACK: shouldn't be needed
228   end
229
230   ##
231   # True if the dependency will not always match the latest version.
232
233   def specific?
234     @requirement.specific?
235   end
236
237   def to_specs
238     matches = matching_specs true
239
240     # TODO: check Gem.activated_spec[self.name] in case matches falls outside
241
242     if matches.empty? then
243       specs = Gem::Specification.all_names.join ", "
244       error = Gem::LoadError.new "Could not find #{name} (#{requirement}) amongst [#{specs}]"
245       error.name        = self.name
246       error.requirement = self.requirement
247       raise error
248     end
249
250     # TODO: any other resolver validations should go here
251
252     matches
253   end
254
255   def to_spec
256     matches = self.to_specs
257
258     matches.find { |spec| spec.activated? } or matches.last
259   end
260 end
4

1 回答 1

3

您是否确保该乘客在您的 Gemfile 中?我看到您安装了捆绑程序,我认为这与您的堆栈跟踪中的 ruby​​_noexec_wrapper 有关。

于 2012-09-24T16:28:27.613 回答