【问题标题】:Foreman start throws .profile not found error in ubuntu 10.04Foreman start 在 ubuntu 10.04 中抛出 .profile not found 错误
【发布时间】:2012-12-14 23:03:53
【问题描述】:

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

  1. 使用 Ubuntu 10.04 机器安装工头
  2. 安装的Ruby版本是:1.9.3-p362
  3. 安装的Rubygems版本是:1.8.24
  4. 我可以触发一个工作正常的示例 test.rb 文件。代码如下:

    root@ubuntu-test:~# cat test.rb
    
    #/usr/local/rvm/rubies/ruby-1.9.3-p362/bin/ruby
    require 'rubygems'
    puts "Hello world!"
    
  5. 使用代码创建了一个 Gemfile:

    source :rubygems
    gem 'sinatra', '1.1.0'
    gem 'thin'
    
  6. 使用以下代码创建了一个 Procfile: 网络:捆绑执行 ruby​​ test.rb -p $PORT

  7. 发出工头启动 - 失败如下:

    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

这可能是因为路径设置错误吗?是什么阻止了工头启动?

  • 拉梅什

【问题讨论】:

    标签: ubuntu foreman .profile


    【解决方案1】:

    我遇到了类似的错误,但更详细:

    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,工头现在运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-06-16
      • 2018-12-29
      • 2012-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-18
      • 1970-01-01
      相关资源
      最近更新 更多