gpt4 book ai didi

ubuntu - Foreman start 在 ubuntu 10.04 中抛出 .profile not found 错误

转载 作者:行者123 更新时间:2023-12-04 19:21:58 29 4
gpt4 key购买 nike

我正在尝试将工头用于heroku。这是我的设置中存在的内容:

  • 使用 Ubuntu 10.04 机器安装工头
  • 安装的 Ruby 版本为:1.9.3-p362
  • 安装的 Rubygems 版本为:1.8.24
  • 我可以触发一个工作正常的示例 test.rb 文件。下面的代码:
    root@ubuntu-test:~# cat test.rb

    #/usr/local/rvm/rubies/ruby-1.9.3-p362/bin/ruby
    require 'rubygems'
    puts "Hello world!"
  • 使用代码创建了一个 Gemfile:
    source :rubygems
    gem 'sinatra', '1.1.0'
    gem 'thin'
  • 使用代码创建了一个 Procfile:
    网络:捆绑执行 ruby​​ test.rb -p $PORT
  • 发布工头开始 - 失败如下:
    06:37:09 web.1  | started with pid 3638
    06:37:09 web.1 | .: 39: .profile: not found
    06:37:09 web.1 | exited with code 2
    06:37:09 system | sending SIGTERM to all processes
    SIGTERM received

  • 我还安装了特定版本的工头(0.60.2),它在启动时显示与上述相同的错误。

    .profile 文件位于我机器的以下位置:
        /home/user/.profile
    /etc/skel/.profile
    /root/.profile

    其中包含:
    # ~/.profile: 由兼容 Bourne 的登录 shell 执行。
    if [ "$BASH" ]; then
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi
    fi

    mesg n

    这可能是因为路径设置错误吗?是什么阻止工头启动?
  • 拉梅什
  • 最佳答案

    我遇到了类似的错误,但细节略多:

    21:16:46 bridge.1 | /var/lib/gems/1.9.1/gems/foreman-0.61.0/bin/foreman-runner: 37: .: .profile: not found

    因此,我查看了 foreman-runner ,看起来它正在尝试从当前目录加载 .profile 文件。虽然我正在从我有一个 .profile 的目录运行工头,但它仍然没有找到它。

    似乎使用 -p 参数调用了 foreman-runner。然后它会测试 .profile 文件是否存在,然后才会尝试获取它。因此它会检查文件但无法获取它。实际做源代码的行如下:
    . .profile

    该文件开始 #!/bin/sh 所以我运行/bin/sh 并尝试了 . .profile 从命令行,果然它提示 .profile 没有找到,是吧?!其实它说的是:
    /bin/sh: 4: .: .profile: not found

    那个4在那里做什么?也许它只是不喜欢我的 .profile 中的某些内容。

    所以我将我的 .profile 移到 profile.bak 和 viola,工头现在运行。

    关于ubuntu - Foreman start 在 ubuntu 10.04 中抛出 .profile not found 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14090554/

    29 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com