capistrano-plugins / capistrano-unicorn-nginx

Capistrano tasks for automatic and sensible unicorn + nginx configuration
MIT License
175 stars 81 forks source link

LoadError: cannot load such file -- capistrano/unicorn-nginx #1

Closed notapatch closed 10 years ago

notapatch commented 10 years ago

Hello bruno

I tried to follow your instructions and had problems. I can recreate it by following this short list.

Create a basic rails 4 application, Capfiy and run capistrano.

$ rails new basic -d postgresql
Gemfile: gem 'capistrano', '~> 3.1.0', group: :development
$ bundle install
$ cap install
$ cap production deploy
INFO [3338420f] Running /usr/bin/env mkdir -p /tmp/my_app_name/ on example.com
DEBUG [3338420f] Command: /usr/bin/env mkdir -p /tmp/my_app_name/
.... times out as it hasn't been configured .... 

Then I add capistrano-unicorn-nginx to the gemfile and unicorn-nginx to the capfile.

Capfile: require 'capistrano/unicorn-nginx'
Gemfile: gem 'capistrano-unicorn-nginx', '~> 1.0.2', group: :development
$bundle install 
$ cap production deploy

Now when I run capistrano I immediately get:

LoadError: cannot load such file -- capistrano/unicorn-nginx
/home/richard/code/basic/Capfile:6:in `<top (required)>'
(See full trace by running task with --trace)

If I change it to require 'capistrano/unicorn_nginx' it stops erroring but don't know if that's understanding the problem. I've used your capistrano postgresql gem and followed similar instructions and that was fine.

bruno- commented 10 years ago

Hi Richard, thank you for reporting the issue.

Unfortunately the line require 'capistrano/unicorn-nginx' has a typo in the README (hyphen should be an underscore)! So, it should be require 'capistrano/unicorn_nginx.

It seems you correctly changed it in the process described above. I'll fix this in the README right now.

Hey, I created this plugin just last weekend. I asked a couple developer friends to try it out, give feedback so I can iron-out issues just like the one you found. If you find anything else, please let me know!

notapatch commented 10 years ago

I certainly will keep you informed about the experience. The capistrano postgresql has tidied my code up - it's much cleaner than my implementation code so it's a big win for me.

I can't find anything about capistrano plugins is there something to read or have you just learn't it from other people's plugins?

bruno- commented 10 years ago

Hey Richard, good to hear capistrano-postgresql has helped you!

About developing capistrano plugins: as far as I know, there's no educational page, or anything like that unfortunately.

I've learned mostly from existing plugins that are under capistrano github namespace. For example: capistrano/rbenv and capistrano/rails. These are pretty small plugins actually and you can "grasp" the basic plugin organization pretty quickly.

The last thing that was helpful for me was the actual capistrano source code. Specifically, the default capistranon deploy task file. You'll be surprised how small and readable that file is. By being the "default" capistrano task, I think it's a good way to learn how the tasks should look like..

I'm going to close this issue, but let me know if you need other instructions or help around capistrano plugins. (even though the issue is closed I'll still receive an email notification if someone posts here)