How to Setup Ruby on Rails with Windows?
Requirements: Windows OS (10/8/7), Ruby Installer v2.3 or upper
At first, we need to install Ruby on our system.
- Go to Ruby official site http://rubyinstaller.org/downloads/ then download the latest version of Ruby, then install it on your specific location.
#=> After installing ruby check the version
$ ruby -v
ruby 2.3.1p112 # Or somthing like this
- Then download Development Kit from the same link as above.
- Create a folder which called devkit inside the Ruby folder
- Extract downloaded devkit inside the devkit folder
- Run command inside the devkit folder
$ ruby dk.rb init
$ ruby dk.rb install
- Run command inside the ruby folder “gem install rails”
$ gem install rails
#=> After installing rails check version
$ rails -v
- Create rails project
$ rails new project
#=> After created project then below command
$ cd project
$ bundle install
#=> Configure database
$ bundle exec rake db:create
$ bundle exec rake db:migrate
$ rails server
=> Booting Puma
=> Rails 5.0.6 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
*** SIGUSR2 not implemented, signal based restart unavailable!
*** SIGUSR1 not implemented, signal based restart unavailable!
*** SIGHUP not implemented, signal based logs reopening unavailable!
Puma starting in single mode...
* Version 3.10.0 (ruby 2.3.1-p112), codename: Russell's Teapot
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
- Open the browser. Write “localhost:3000” on address bar and press Enter key.
That’s all! Enjoy development/programming with Ruby on Rails 🙂
Sidekiq has been my favorite tool for setting up background processing in Ruby on Rails applications. Mainly I use it for delivering emails, update data inside tables & much more… and it can take a little effort to get up and running every day in exact time on i.e. Heroku.
I have worked with Heroku Scheduler jobs but I have found some issues which explained there documentation that’s why I’m using Sidekiq Scheduler.
Follow below steps:
gem install sidekiq-scheduler
or you can use your Gemfile
gem 'sidekiq', '~> 3.3.0'
# sidekiq scheduler
gem 'sidekiq-scheduler', '~> 1'
Then create a folder inside app directory which name “workers”.
Create a file inside workers folder like “hello_world.rb”.
def perform #=> you can write anything based on your action like 'send_email' or 'newslatter' etc ...
puts 'Hello World'
Now you can go your config file
every: 1m # Runs once per minute
bundle exec sidekiq
Redis is required for sidekiq, install this on your Heroku app then past this on your Procfile same as below-
worker: bundle exec sidekiq -c 5 -v
Then push to your production.
Happy coding 🙂
How to enable users activity tracking using the public_activity gem?
On Rails, the public_activity provides easy way for tracking activity for ActiveRecord, Mongoid 3 and MongoMapper models. Simply we have to put records what has been changed or created and that will gives the ability to present those recorded activities to users. Following Github screenshot showing the expected output from the Rails users activity tracking-
Following steps we have to follow: (ActiveRecord only)
gem 'public_activity' on your Gemfile
rails g public_activity:migration
Now let’s configure the Model
class Post < ActiveRecord::Base
@post.create_activity key: 'post.commented_on', owner: current_user
@activities = PublicActivity::Activity.all
That’s all for tracking all activities.
Happy coding 🙂
Salah Software Solution is an award winning software company based in Sylhet, Bangladesh. The company is going to hire new team member for following full-time position-
WordPress Developer – 2
- Develops web applications, database-driven web pages, web tools and dynamic areas within web pages designed to enhance, sustain and support ideas and vision of the area in compliance with established styles and standards.
- Integrates user-developed content, and identifies and troubleshoots errors and/or problems with web-based applications.
- Participates as either project lead or team member in a wide variety of development projects.
- Remains abreast of technology directions, initiatives and trends within the scope of expertise to provide ideas, guidance, and recommendations.
Desired Qualifications: Experience in
- WordPress themes and plugins development
- WordPress website speed optimization
- Mobile and responsive web design
- Developing varied web applications using PHP, MySQL, and PostgreSQL
- Providing technical guidance on WordPress based projects
- Database design and development on multiple projects
- WordPress themes, plugins and how they function
- CSS and standards for consistent user experience of websites
- SEO best practices
- You are fluent in English
- You are good at utilizing common sense
- You think positive and happy to assist others
- You are ready to work minimum 1 year with us
- You are not lazy and demotivated
- You are a hard worker and always welcome taking challenges
- You can work under pressure and meet deadline
- Festival bonus
- Performance bonus
- Marriage and new Baby benefits
- Free lunch and snacks
- Team outing
How to Apply
Please send your updated CV with a cover letter mentioning why we should hire you and expected salary. Also, make sure you added portfolio link on your CV. Email subject should be in following format “WordPress Developer – Your Name – Sep17”. Only send PDF format files to-
Application deadline: 30 September, 2017
Notes: Please only apply if you are experienced with WordPress and can able to do any kinds of WordPress based project work. We encourage you to not apply if your study/degree hasn’t been completed yet. Thank you!