how to deploy and view my app

  • Question
  • Updated 6 years ago
my deploy.rb is like the image added.I do not know if it is set properly.I add the file in my rails root directory,and in my ruby console tying: cap deploy(from the rails app root).The console tell me there is no this task.It seems i am not able to deploy my app to my server.I have my server running all the time.can you help me?
Photo of daociyiyouD

daociyiyou

  • 7 Posts
  • 0 Reply Likes
  • confused

Posted 6 years ago

  • 1
Photo of Yan Pritzker

Yan Pritzker

  • 65 Posts
  • 5 Reply Likes
Hi, let me try to help you out with this. What capistrano version are you using? (Run 'cap --version'). I am using 2.5.8 and it does appear the deploy task works correctly. I do believe this script works with cap 2.3 and above.
Photo of daociyiyouD

daociyiyou

  • 7 Posts
  • 0 Reply Likes
i use cap 2.3.
Photo of Yan Pritzker

Yan Pritzker

  • 65 Posts
  • 5 Reply Likes
It's possible that something in your rails app is overriding this task? Try generating a brand new app

rails tempapp
cd tempapp
capify .

then copy our deploy.rb into the tempapp/config directory and try again...?
Photo of Yan Pritzker

Yan Pritzker

  • 65 Posts
  • 5 Reply Likes
BTW, I now just realized that maybe you never ran 'capify' on your rails app..you do need to do that before using our deploy.rb to get the default capistrano tasks) - the 'deploy' task is something that comes with capistrano out of the box
Photo of daociyiyouD

daociyiyou

  • 7 Posts
  • 0 Reply Likes
thank you ,Yan Pritzker. I can cap deploy now.But i still can not deploy and access my rails app,getting some like the image.I restart the rails server,but can not access my rails app.
Photo of Yan Pritzker

Yan Pritzker

  • 65 Posts
  • 5 Reply Likes
Hi, connection failed typically means that you can't reach the ip specified. Are you sure it's the ip of your server? Can you ssh to it normally using ssh cftuser@192.168.46.128

Also, May I recommend using pastie.org to paste the output of your commands - it may be easier than a screenshot.
Photo of Yan Pritzker

Yan Pritzker

  • 65 Posts
  • 5 Reply Likes
Also I find the servers: [""] line suspicious. It sounds like capistrano didn't pick up on the server ip. Are these lines present in your deploy.rb:

set :deploy_to_ip, "192.168.46.128"
role :app, deploy_to_ip
role :web, deploy_to_ip
role :db, deploy_to_ip, :primary => true

Also, try running 'cap deploy:long' to see if that makes any difference.
Photo of daociyiyouD

daociyiyou

  • 7 Posts
  • 0 Reply Likes
hi
I do what you tell me.It works.But got another error like the image. Sorry,it is still an image.can you help me?
Photo of Yan Pritzker

Yan Pritzker

  • 65 Posts
  • 5 Reply Likes
Hi, I see that you are running on windows. Unfortunately we cannot help with windows deployments at this time. We do not recommend windows as a deployment platform for capistrano. It looks like it's having some problems with a temp directory. This might be capistrano's bug or some wierd interaction with windows.

May I suggest building or downloading an ubuntu virtual machine to use for your working VM, from which you can deploy under linux.
Photo of Yan Pritzker

Yan Pritzker

  • 65 Posts
  • 5 Reply Likes
I should also note that our rails site was developed to demo the ability to build custom rails servers. If you are looking to just get started with playing around with Rails, I recommend following the tutorials on rubyonrails.org and using a 'blank' virtual machine to start with.

If you are an advanced user, or already have an app that works and that you have deployed to other servers, you can use your same capistrano recipe that you've used to deploy it with our server. Our cap script has only been provided as a demo to show you how placing it in that directory can make it work with the default mongrel setup, but all of that can be customized if you are an advanced rails user.
Photo of daociyiyouD

daociyiyou

  • 7 Posts
  • 0 Reply Likes
Thanks,Yan Pritzker!