- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在docker容器中使用Passenger(v5.1.4)+ Nginx设置rails(v4.2.6)应用程序。
我使用官方 ruby 2.3.1作为基本图像。
以下是我的网站nginx文件
server {
server_name example.local;
listen 4000;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /www/app/public;
passenger_ruby /usr/local/bin/ruby;
try_files $uri @passenger;
location @passenger {
passenger_enabled on;
rails_env development;
}
...
}
passenger_pre_start http://0.0.0.0:4000/status;
/usr/local/bin/ruby
上存在Ruby二进制文件/usr/local/bundle
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:
GEM_HOME
和
GEM_PATH
以更正gem路径,即
/usr/local/bundle
。但是它不起作用。
rvm
最佳答案
出现此问题的原因是user_sandboxing by passenger
由于我的应用程序目录归root所有,并且我没有在nginx中配置passenger_default_user
,所以passenger盯着应用程序作为用户nobody
和组nogroup
我通过将应用目录的所有者更改为非root用户来解决此问题。
注意:另外我还必须使用rvm而不是ruby:2.3.1基本镜像。
关于ruby - $ GEM_HOME和$ GEM_PATH在旅客中设置错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44589721/
RubyGems 是 Ruby 编程语言的包管理器,它提供了一种用于分发 Ruby 程序和库的标准格式(以一种称为“gem”的自包含格式),一种旨在轻松管理 gem 安装的工具,以及用于分发它们的服务
我像这样从 jar 运行 jruby: java -jar jruby-complete-1.6.6.jar 我使用以下命令行安装了 pry: GEM_HOME=~/jruby java -jar j
我设置了 $GEM_HOME,但是 gem install 仍在安装到默认的 ~/.gem 目录。 This rubygems issue说要删除 .gemrc 中的 --user-install 选
Ruby gems 的默认搜索路径是什么?我正在尝试确定可以将哪些目录传递给 gem 的 --install-dir 开关,这样我就不必设置环境变量 GEM_HOME 表示要找到的 gem 。 特别是
我正在使用我的程序附带的 gem,我只是这样做 Gem.path.insert(0, basedir + '/packages/lib') 它有效(basedir 已设置)。现在这适用于我们拥有的旧
我目前正在开发一个 ruby 应用程序,但它运行得非常(非常!)慢..到目前为止,我已经尝试了几件事,我可以将其缩小到主要问题:Ruby 正在尝试在 $LOAD_PATH 的每个目录中查找它的需求
如何避免 gem 清理特定错误。我在执行 gem 清理时看到以下错误。 Gem::InstallError: gem-wrappers 未安装在 GEM_HOME 中 gem cleanup Clea
我每次打开终端时都会收到这个错误: 警告:PATH 设置为 RVM ruby 但未设置 GEM_HOME 和/或 GEM_PATH,请参阅: https://github.com/wayneese
我是一名优秀的程序员,十分优秀!