0

我正在尝试将工头用于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: web: bundle exec 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

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

  • 拉梅什
4

1 回答 1

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

于 2013-03-07T02:38:12.283 回答