📜 ⬆️ ⬇️

Locum + Capistrano + git on Windows: A Little Placement Adventure

I post this little note, apparently more for myself. Today I had the first experience of uploading the RoR application to Locum hosting using the Capistrano bundle and git on Windows 7. I had to suffer - the first pancake almost got a lump.

Introduction


Perhaps for a start I will describe what I wanted to get.
I wanted to play around with Synergy (e-commerce gems for Rails 3.0.10). At the same time I thought to try how convenient it is to deploy an application to a lock. Followed the instructions - and everything seemed to go, though not like clockwork, but normal for the first time.

My steps


  1. I got an account on Locum
  2. Created a project for RoR on Ruby 1.9.3
  3. I installed Ruby 1.9.3 on my local machine.
  4. Install Git 1.7.8; cried for the fact that, as before, in the console of the gita on Windows, the irb text input works disgustingly (I mean moving the cursor with the keyboard keys)
  5. Installed Aptana 3 - and, as it turned out later, did the right thing.
  6. First, by mistake I installed the last rails, causing the default installation of the heme.
  7. Then I decided to follow all the same instructions for installing Synergy and launched the installation of rail version 3.0.9 (!) , Which turned out to be in vain.
  8. “Bundle install” could not be executed - it turned out that the gems added according to the instructions depend on the rail version 3.0. 10 ; corrected in the gemfile version and drove on.
  9. In the “rails g spree: site -f” step, the Synergy instructions received an error about “libmysql.dll”
  10. I downloaded the MySql5 server installer - in vain for two reasons: first, the server is not needed, but only the “MySql connector” is needed; secondly, as it turned out later, the sixth version was needed; here, honestly speaking, I started to get upset - I thought on the server, in case something happens, I couldn’t be able to update it.
  11. Further, according to the instructions, everything went fine; The application has started.
  12. Made the first kammit; I began to think how to deploy. Locum recommends using Capistrano - did not begin to object.
  13. Put the cap; crossed the cap setup instructions and generated by the hoster “deploy.rb”
  14. I created it via SSH (I used vim, only then I found out about the file manager on top of SSH) on hosting “database.yaml”:
    development:
    adapter: mysql2
    database: *db_name*
    username: *db_user*
    encoding: utf8

    production:
    adapter: mysql2
    database: *db_name*
    username: *db_user*
    password: 123... #
    host: mysql0.locum.ru
    encoding: utf8

    test:
    adapter: mysql2
    database: *db_name*
    username: *db_user*
    encoding: utf8
  15. Started working on instructions for Cap ; "Cap deploy: setup" worked fine.
  16. And then I was waiting for a failure with "cap deploy":
    $ cap deploy
    * executing `deploy'
    * executing `deploy:update'
    ** transaction: start
    * executing `deploy:update_code'
    executing locally: "git ls-remote /e/Projects/RoR/testr/ HEAD"
    command finished in 80ms
    * getting (via checkout) revision 7041c492377617a09251281c1b9544a955892f70 to
    C:/Users/.../Temp/20120128194958
    executing locally: git clone -q /e/Projects/RoR/testr/ C:/Users/dev/
    AppData/Local/Temp/20120128194958 && cd C:/Users/dev/AppData/Local/Temp/20120128
    194958 && git checkout -q -b deploy 7041c492377617a09251281c1b9544a955892f70
    Too many arguments.
  17. He began to scour the network and that's what he found
  18. He also started hacking the ill-fated "base.rb" - he decided to immediately break the command there and execute the subcommands in a loop in order to at least make sure that this was the problem. But alas, “cap deploy” for some reason did not respond to my hacks. The question remained open to me, because I scored on butting with the wall and decided to look for another solution - even if not as convenient as “cap deploy”, but working on Windows (they write online that there is no such trouble on Linux).
  19. In the end, I discovered the master of deployment in Aptana, I selected it through sFTP, and while the application was unloaded I decided to present my adventures in a blog.

Conclusion


Thanks Aptana!
I hope someone will be useful!
So far, the impressions about Locum are good - in spite of my small experience, there were no special problems and I didn’t apply to the support.
And I don’t know whether to post a bunch of Cap and git? Yes, and which of them is not yet clear. Certainly not on CMD.exe - it probably has not been supported for a long time.

Upd : The instructions for installing Synergy are updated. Well done!

')

Source: https://habr.com/ru/post/137208/


All Articles