0

I use chef to run bundle.

bash "feedbin_bundle" do
   cwd "/home/ubuntu/workspace/frontend"
   user "root"
   group "root"
   code <<-EOH
     bundle install
   EOH
end

Now I want to run the below as ubuntu user:

ubuntu@ubuntu:~/workspace/frontend$ rake db:setup
'git://github.com/feedbin/activerecord-import.git (at b7851b1) is not checked out. Please run `bundle install`

If I run as root all is well. How to I avoid the above error and run rake db:setup?

4

2 回答 2

1

这里的问题是您的 gems 是为 user 安装root~root/.gems目录中的。你不想要这个。你有三种可能:

  • 通过调整/etc/gemrc文件在系统范围内安装 gems
  • 以运行应用程序的用户身份安装 gems
  • “干净”的解决方案:将 gems 安装在vendor子目录中:bundle install --path=vendor/. 这样,gems 只为项目安装,不会与其他项目冲突。
于 2013-10-11T13:53:35.190 回答
0

您应该以您想用来运行程序的同一用户身份运行bundle installubuntu

于 2013-09-14T10:35:50.673 回答