Sign in through GitHub

Eric Wanchic's Profile

GitHub User: wanchic

Comments by Eric Wanchic

Avatar

Solved! I received some help on this. I figured it had something to do with environment variables getting lost, and I was right. unicorn needs to have an rvm ruby wrapper around it, by executing:

rvm wrapper 1.9.3 ruby-1.9.3 unicorn

and it creates a new init script to run called:

ruby-1.9.3_unicorn

afterwards you'll need to modify the unicorn_init.sh $CMD to read something like:

/usr/local/rvm/bin/ruby-1.9.3_unicorn -D -c $APP_ROOT/config/unicorn.rb -E production

See http://stackoverflow.com/questions/10454292/ubuntu-12-04-unicorn-init-sh-start-works-but-service-unicorn-init-start-do for more info.

Avatar

Problem in Ubuntu Server

If I run $ /etc/init.d/unicorn start, it runs just fine.
If I run $ service unicorn start, I get this error:

/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require': cannot load such file -- bundler/setup (LoadError)
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in 'require'
from /var/rails/mbiri/shs/bin/unicorn:14:in ''

I cannot figure out why /etc/init.d would work, but service would not. It's driving me crazy trying to find the answer. I also think this is the reason why unicorn won't start on boot, because I'v already ran update-rc.d

Avatar

I cannot seem to get that to work under Ubuntu. Any ideas?

Avatar

Your correct, vagrant is not necessary. You can set everything up as usual. But where you might ask?

On server, I create the projects directory under /var/rails and somtimes suffixed with ./client-foo/project-bar

This is in tradition where apache sites are stored under /var/www.

So in other words, instead of:
/vagrant

use:
/var/rails
/var/rails/site
/var/rails/client-foo/project-bar

Avatar

Dido on that request.

I discovered this link. It might be of help:
Thin vs unicorn vs passenger (http://www.ruby-forum.com/topic/1822610)

Avatar

If I have a production site in a separate folder (www.somesite.com/appFolder/), then I'm not able to get the tokenInput to work correctly. Instead of:

ruby
tokenInput("/tags.json", ...

I need to say something like:

ruby
tokenInput("/appFolder/tags.json", ...

Is there a DRY way to do this so I do not have to manually edit the code on the production site every time? Thanks.

Avatar

Yes, I was able to get this working in 3.1, coffescript style:

ruby
jQuery ->
  $("#patient_tag_tokens").tokenInput("/tags.json", {
    crossDomain: false,
    prePopulate: $("#patient_tag_tokens").data("pre"),
    theme: "facebook",
    preventDuplicates: true
  });
Avatar

What is the HTML supposed to look like again?