Skip to main content

Posts

Ruby On Rails with Nginx With Passenger Deployment?

Ruby On Rails  with Nginx With Passenger Deployment? Ruby Installation #sudo apt-get update #sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev #wget http://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz #tar -xzvf ruby-2.2.3.tar.gz #cd ruby-2.2.3/ #./configure #make #sudo make install #ruby -v Rails Installation Since Rails ships with so many dependencies these days, we're going to need to install a Javascript runtime like NodeJS. This lets you use Coffeescript and the Asset Pipeline in Rails which combines and minifies your javascript to provide a faster production environment. To install NodeJS, we're going to add it using a PPA repository: sudo add-apt-repository ppa:chris-lea/node.js sudo apt-get update sudo apt-get install nodejs gem install rails -v 4.2.4 MongoDB I...

Sending Mobile SMS in Ruby on Rails using twilio

Sending Mobile SMS in Ruby on Rails using twilio? gem install twilio-ruby In Controller U need to add the  require 'twilio-ruby' @account_sid = 'AC3ddc5567a441ea2fdf0a460452599aa6'  @auth_token = '9aefac893c9c9214770046ecb796d6c8' @client = Twilio::REST::Client.new(@account_sid, @auth_token) p @client.account @client.account.messages.create(from: '+12019044303', to: '+919538947694',body: 'Hello koteshwarrao welcome to my blog') Notes: From number is nothing but twillo number To Number is from whom u need to send the message Use Only Live credentials only @account_sid is twilio account id @auth_token is twilio auth token Before Sending any message to mobile the mobile number need to be verified to twilio account.

PayUMoney Integration in Ruby on Rails

PayUMoney Integration in Ruby on Rails Generating Cheksum in Payu    Hash or Checksum = sha512(key|txnid|amount|productinfo|firstname|email|u df1|udf2|udf3|udf4|udf5||||||salt) Controller Code Will be def payumoney   @key = "gtKFFx"   @salt =  "eCwWELxi"   val = "#{key|txnid|amount|productinfo|firstname|email|u df1|udf2|udf3|udf4|udf5||||||#{@salt}"  @checksum = Digest::SHA512.hexdigest("#{val}") end <form action="https://test.payu.in/_payment" method='post' id='sub'  >     <input type="hidden" name="key" value="<%=@key%>">     <input type="hidden" name="hash" value="<%=@checksum%>">     <input type="hidden" name="txnid" value="TXN1234">     <input type="hidden" name="amount" value="200">     <input type="hidden" name=...

PayUMoney Integration in Ruby on Rails

PayUMoney Integration in Ruby on Rails Generating Cheksum in Payu    Hash or Checksum = sha512(key|txnid|amount|productinfo|firstname|email|u df1|udf2|udf3|udf4|udf5||||||salt) Controller Code Will be def payumoney   @key = "gtKFFx"   @salt =  "eCwWELxi"   val = "#{key|txnid|amount|productinfo|firstname|email|u df1|udf2|udf3|udf4|udf5||||||#{@salt}"  @checksum = Digest::SHA512.hexdigest("#{val}") end <form action="https://test.payu.in/_payment" method='post' id='sub'  >     <input type="hidden" name="key" value="<%=@key%>">     <input type="hidden" name="hash" value="<%=@checksum%>">     <input type="hidden" name="txnid" value="TXN1234">     <input type="hidden" name="amount" value="200">     <input type="hidden" name=...

Document Preview in Rails?

Document Preview in Rails? Display the doc preview  in iframe? <iframe src='https://docs.google.com/viewer?url=www.google.com/doc/kotesh.docx&embedded=true' frameborder='0'></iframe> Display the doc preview  in new page? <a href= "https://docs.google.com/viewerng/viewer?url=url=www.google.com/doc/kotesh.docx&embedded=true" target= "_blank">Doc PreView</a>

Production deployment steps in rails?

Production deployment steps in rails? List of steps for Production deployment 1)In app folder -> git pull origin master 2)bundle install --path vendor/bundle 3)rake assets:precompile RAILS_ENV=production 4)touch tmp/restart.txt 5)If u want to restat server level command is  sudo service nginx restart 6)Stop the nginx server command is sudo service nginx stop 7)Starting the nginx server command is sudo service nginx start