Passenger FreeBSD 'not found', nginx not started

363 views
Skip to first unread message

BeeRich33

unread,
Jan 4, 2016, 4:09:47 AM1/4/16
to Phusion Passenger Discussions
Just installed nginx and passenger on a FreeBSD box.  It can't be found for some reason:

/home/rich/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'passenger' (>= 0) among 11 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/root/.gem/ruby/2.2.0:/home/rich/.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0', execute `
gem env` for more information
 from /home/rich/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/dependency.rb:324:in `
to_spec'
 from /home/rich/.rvm/rubies/ruby-2.2.3/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'

 
from /home/rich/.rvm/gems/ruby-2.2.3/bin/passenger-config:22:in `<main>'


[Mon Jan 04 03:59:53 rich@shuttle ~]  gem list

*** LOCAL GEMS ***

bigdecimal (1.2.7, 1.2.6)
bundler (1.11.2)
cups (0.1.10)
gem-wrappers (1.2.7)
io-console (0.4.5, 0.4.3)
json (1.8.3, 1.8.1)
minitest (5.8.3, 5.4.3)
passenger (5.0.23)
power_assert (0.2.6, 0.2.2)
psych (2.0.17, 2.0.8)
rack (1.6.4)
rake (10.4.2)
rdoc (4.2.1, 4.2.0)
rvm (1.11.3.9)
test-unit (3.1.5, 3.0.8)

nginx was installed with the --with-passenger config:

nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: [emerg] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed

[Mon Jan 04 04:01:12 rich@shuttle ~]  service nginx start
Performing sanity check on nginx configuration:
nginx: [alert] could not open error log file: open() "/var/log/nginx-error.log" failed (13: Permission denied)
2016/01/04 04:02:10 [warn] 10065#100112: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/etc/nginx/nginx.conf:2
2016/01/04 04:02:10 [info] 10065#100112: Using 32768KiB of shared memory for push module in /usr/local/etc/nginx/nginx.conf:43
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
2016/01/04 04:02:10 [emerg] 10065#100112: open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)
nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
Starting nginx.
nginx: [alert] could not open error log file: open() "/var/log/nginx-error.log" failed (13: Permission denied)
2016/01/04 04:02:10 [warn] 10066#100112: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/etc/nginx/nginx.conf:2
2016/01/04 04:02:10 [emerg] 10066#100112: open() "/usr/local/var/log/error.log" failed (2: No such file or directory)
/usr/local/etc/rc.d/nginx: WARNING: failed to start nginx


/var/log/:
-rwxr-xr-x   1 root  wheel     5.5K Jan  4 04:06 nginx-error.log

My nginx.conf:

user                    www wheel;
worker_processes        2;

error_log               /usr/local/var/log/error.log  debug;
pid                     /usr/local/var/run/nginx.pid;

events {
    worker_connections          1024;
}


http {
        index           index.html index.erb;
        access_log      /usr/local/var/log/access.log;

        passenger_root /usr/local/lib/ruby/gems/2.1/gems/passenger-5.0.22;
        passenger_ruby /usr/local/bin/ruby21;

                passenger_friendly_error_pages on;

                server {
                        listen                  80;
                        server_name             shuttle.local;
                        include                 /usr/local/etc/nginx/mime.types;
                        access_log              /usr/local/var/log/access_shuttle.log;
                        error_log               /usr/local/var/log/error_shuttle.log  debug;
                        error_page  404         /404.html;
                        root                    /Library/WebServer/Documents/shuttle/public;
                        passenger_enabled on;
                        passenger_base_uri      /;
                        passenger_env_var DATABASE_USERNAME alpha;
                        passenger_env_var DATABASE_PASSWORD alpha_password;

                        location / {
                                autoindex off;
                                index index.html;
                        }

                        location = /img/favicon.ico { access_log off;}
                }
        }

Now I know the www root is wrong, but I can't get nginx started.  There is no nginx.pid file.  Not sure what to do.

Any advice appreciated.  

Cheers

Hongli Lai

unread,
Jan 4, 2016, 5:13:58 AM1/4/16
to phusion-passenger
Since Nginx complains about permission errors and nonexistent
directories and such, maybe you should start Nginx with root
privileges and maybe you should create any nonexistant directories?

Also, you have multiple Ruby installations on your system. The Ruby
that you're using on the shell (/home/rich/.rvm/rubies/ruby-2.2.3) is
clearly different from the one that you told Passenger to use
(/usr/local/bin/ruby21). So you need to fix that by telling Passenger
which Ruby interpreter it's supposed to use.
> --
> You received this message because you are subscribed to the Google Groups
> "Phusion Passenger Discussions" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phusion-passen...@googlegroups.com.
> To post to this group, send email to phusion-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/phusion-passenger.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phusion-passenger/d4dcf30d-7f52-4f44-9755-47e1531f5fa4%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion B.V. | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 63501007 (The Netherlands)
Reply all
Reply to author
Forward
0 new messages