"Sending email with Ruby on Rails 2.3.5 and gmail"

If you need an easy way to setup email for your company or for a client it’s hard to not love Google Apps. (The ’standard’ ie free version is here).


It is very likely that at some point you will need to send out emails from your application. Don’t cry. Gmail can do this for you. Rails 2.3.2 makes it easier than ever with the addition of ‘enable_starttls_auto’. Put the following code in production.rb, development.rb or environment.rb and you ’should’ be able to send out emails:


<script src=”http://gist.github.com/450198.js?file=Sending%20email%20with%20Ruby%20on%20Rails%202.3.5%20and%20gmail”></script&gt;


If you are one of the lucky ones this will actually work. It didn’t work for me but since I still needed to get email working here’s what I did:


First be sure to activate the email account that you are using. To do that you only need to login. Google will walk you through entering a captcha etc.


You might get this error:

Net::SMTPAuthenticationError: 530 5.7.0 Must issue a STARTTLS command first.


If you do then check your Ruby version. Ruby 1.8.7 has this built in but Ruby 1.8.6 does not.


The next best thing is to get action_mailer_tls. Most of the links you will find in forum and blog posts are broken. The code is on github and neatly packaged as a gem: http://github.com/openrain/action_mailer_tls/tree/master. Follow the directions to install and configure the plugin there and you should be able to send email.


Here’s a couple of handy conversations for reference:


http://www.railsforum.com/viewtopic.php?id=28480


http://www.ruby-forum.com/topic/184137

"Sending email with Ruby on Rails 2.3.5 and gmail"

"Error in ruby relative_path_from call on windows"

I was playing around with “SPREE COMMERCE”after a long term on my windows machine , before this have always used my linux box for Spree commerce .


However got stuck at the very first step after bootstrapping a fresh application .


Error :


<script src=”http://gist.github.com/456124.js?file=Error%20Spree%20Extension”></script&gt;


After scratching head for long and loosing 20 hairs atleast drilled down to source of error and monkey patched the error .


Moreover after a little digging, it was evident that the ‘relative_path_from’ method in ‘/ruby/lib/ruby/1.8/pathname.rb’ file had the problem. The problem was also described as a ticket athttp://redmine.ruby-lang.org/issues/show/1366 and the excerpt of the issue is shown below:


Monkey Patch :


<script src=”http://gist.github.com/456124.js?file=Solution%20Ruby%20monkey%20patch%20″></script&gt;


I added the capitalize! keyword at the end of the two lines so that both the paths are in uppercase, so that later in the code ( ) shown below does not barf and give us the error we got shown in the first error of the post.


Overriding original :


<script src=”http://gist.github.com/456124.js?file=Overirding%20code”></script&gt;

"Error in ruby relative_path_from call on windows"

"Installing ImageMagik on Unix/Linux"

Follow the below steps


wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz


Next configure and compile ImageMagick:


tar xvfz ImageMagick.tar.gz
cd ImageMagick-6.6.3
./configure
make


If ImageMagick configured and compiled without complaint, you are ready to install it on your system. Administrator privileges are required to install. To install, type


sudo make install


Finally, verify the ImageMagick install worked properly, type


/usr/local/bin/convert logo: logo.gif


For a more comprehensive test, run the ImageMagick validation suite. Ghostscript is a prerequisite, otherwise the EPS, PS, and PDF tests will fail.


make check
"Installing ImageMagik on Unix/Linux"

"Five quick steps to set up RVM with rails 2 and rails3 "

1 – Installing RVM


$ sudo gem install rvm  <br /><br />$ rvm-install  <br />


Finally put this lines in your .bash_profile or .bashrc:


  if [[ -s $HOME/.rvm/scripts/rvm ]] ; then<br />          source $HOME/.rvm/scripts/rvm<br />  fi<br />


Restart your terminal, Rvm should be working by now.


2 – Installing ruby inside your rvm


$ rvm install 1.8.7<br />


Will install ruby 1.8.7


$ rvm install ruby-head<br />


Will install ruby 1.9.2 or newer.


3 – Setting up rvm to use your specific ruby version


$ rvm use 1.8.7<br />


To use just this time.


$ rvm use 1.8.7 --default<br />


To use always this version.


If you are using any other ruby replace the “1.8.7” for your version.


4 – Installing rails 2 and rails 3 RC inside different gemsets


You can separate your rails versions inside gemsets:


Rails 2:


Create the gemset:


$ rvm gemset create rails2<br />


Setting up rvm to use always this gemset:


$ rvm use 1.8.7@rails2 --default<br />


Installing rails 2:


$ gem install rails<br />


Rails 3:


Create the gemset:


$ rvm gemset create rails3<br />


Setting up rvm to use always this gemset:


$rvm use 1.8.7@rails3 --default<br />


Installing rails 3:


$ gem install rails --pre<br />


5 – Switching between different rails versions


Switching to rails 2:


$ rvm use 1.8.7@rails2<br />$ rails -v<br />Rails 2.3.5<br />


Switching to rails 3:


$ rvm use 1.8.7@rails3<br />$ rails -v<br />Rails 3.0.0.rc<br />
"Five quick steps to set up RVM with rails 2 and rails3 "

"Rails 3 and Bundler: Deploying gems using Capistrano"

I have previously described how to deploy gems using Capistrano in a Rails 2 application. After upgrading to Rails 3, this has changed a bit. Rails now uses Bundler for dependency management, so we need to use the bundle install command instead of rake gems:install.


In your deploy.rb:


after "deploy:update_code", "bundle:install"

namespace :bundle do
  desc "Bundle install"
  task :install, :roles => :app do
    run "cd #{current_release} && #{sudo} bundle install"
  end
end


It’s as easy as that. Let me know if you have any comments.

"Rails 3 and Bundler: Deploying gems using Capistrano"

"8 Free Open Source Ruby on Rails Content Management System"

I want to share for you about 8 Free Open Source Ruby on Rails Content Management System. As we know, Ruby On Rails is an open source Web framework that help you to create web applications more easier, faster & write beautiful code by favoring convention over configuration. 


There are 8 Free Open Source Content Management System Based Ruby on Rails. if you have other, please comment


     

  1. skylinecms

    Skylinecms is  open source Ruby on Rails content management system. Skyline is an flexible and expandable open source content management system that is in constant development. Its feature rich interface allows for fast and intuitive management of websites.

    Demo: http://demo.skylinecms.nl
    Administration: http://demo.skylinecms.nl/skyline
    License: LGPL

  2.  

  3. Refinery

    Refinery is light weight content management system that build with Ruby On Rails. Refinery is free and open sources. It has slick and clean user interface, Modular and extendable. Refinery is Powerful and flexible to allow you to design exactly the site you want.Requirements: Ruby on rails enables on hosting environtment

    Demo: http://demo.refinerycms.com/admin
    License: License Free
    Website:http://refinerycms.com/

  4.  

  5. BrowserCMS

    BrowserCMS is a open source Web Content Management System (CMS), written in Ruby on Rails. BrowserCMS is an easy-to-use, 100% browser-based content management system that is installed on the same web server that hosts your website. It is designed to support three different types of people:

    Non-technical web editors who want a humane system to manage their site, without needing to understand what HTML or even Rails is.

    Designers who want to create large and elegantly designed websites with no artificial constraints by the CMS.

    Developers who want to add a CMS into their Rails projects, or create CMS driven websites for their clients.

    BrowserCMS provide a few list of guides on how the above groups can use BrowswerCMS, to design, build and maintain websites. like; Getting Started , User Guide for BrowserCMS , Installing a Module , Developer and designer’s Guide and much more… Requirements:Rails 2.3

    Source: http://www.browsercms.org
    License: LGPL license

  6. RailFrog CMS

    RailFrog is an Open Source CMS built with Ruby on Rails. This Open Source Content Management System is producing well structured and standards-compliant pages with Web 2.0 goodness.  Railfrog makes it easy for developers, designers, webmasters, or just about anyone else to deploy and manage a website.

    Download : http://www.railfrog.com/download.html

  7.  

  8. Radiant CMS

    Radiant is a open source content management system specially for small developer teams. A simple-yet-powerful Ruby on Rails CMS application with a slick interface, Radiant offers flexibility when you create layouts, snippets, page parts, and a custom tagging language. It also allow Flexible Site Structure to arrange pages according to any hierarchy.

    Radiant has a special macro language called Radius (similar to HTML) which makes it easy to include content from other pages, iterate over page children, and display content conditionally. Radius tags are available in pages, snippets, and layouts.

    It also support for Markdown and Textile, but developers can easily create text filters for any markup language such as RDoc, BBCode, or Structured Text. Radiant is licensed under the MIT License.

    Demo : http://radiantcms.org/demo/ Download : http://radiantcms.org/download/ License: the MIT License.

  9.  

  10. Typo

    Typo is currently on version 5.3 for Ruby on Rails 2.2 and is described as “the oldest and most powerful Ruby on Rails blogware, providing custom templates, powerful drag and drop plugins API, advanced SEO capabilities, XMLRPC API and many more.” This appears to be one of the more active RoR open source CMS projects. Its features include: Customizable SEO interface

    Individual user dashboards

    Two types of content, articles and pages

    Category support

    Tag manager

    Customizable themes    Typo is released under the MIT License.

    Download : http://github.com/fdv/typo/wiki demo : http://demo.typosphere.org/

  11.  

  12. Locomotive

    LOCOMOTIVE is an open source CMS for Rails. It’s super flexible and integrates with Heroku and Amazon S3.

    Download : http://www.locomotiveapp.org/

  13.  

  14. Rubricks

    Rubricks is an open source CMS(Contents Management System) powered by Ruby on Rails. It enables to create your website more smart, simple, and speedy.

    Rubricks adopts the components architecture. You can install the components(BBS, Schedulers, etc..) into Rubricks. Of course, if you make components, many people will install and use them easily.

    Demo : http://rubricks.org/index_en.html 
    Download :http://rubricks.org/index_en.html

"8 Free Open Source Ruby on Rails Content Management System"

"Installing Ruby on Rails on Windows 7"

What is ruby on rails ?


Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for theRuby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development



Rails was created in 2003 by David Heinemeier Hansson and has since been extended by the Rails core team


Who is already on Rails?


  1. Yellow Pages , and many more..

Step by step instalation ruby on rails?


Before doing the installation, This is a tools You Need :


  • Ruby
  • RubyGems
  • Rails (Gem)
  • A Database Engine

Step 1: Install Ruby


  1. Download the latest stable, in this tutorial i use Ruby 1.9.2-p0 and choose 7-Zip Archives.
  2. Extract them and put all the contained directories where you want your Ruby. Mine resides in C:Ruby
  3. Add the newly installed bin directory to your path in your windows system : Open windows explorer-> right click the icon computer-> choose Properties -> in the contol panel Home, Click Advanced system settings and then click Envitonment Variables button->in the system variables click new and add new system variables like this :  Variable name : RUBY_HOME  , Variable Value : C:Ruby, after that add it in to the path and add the bin after a semicolon to the “Path” variable like this : C:Program FilesCommon FilesAdobeAGL;%JAVA_HOME%bin;%ANDROID_HOME%tools;%RUBY_HOME%bin
  4. We have to make sure that our Ruby installation was successful. So we go to our Command Prompt “Start > All Programs > Accessories > Command Prompt” and type the following:

     ruby --version

Step 2: Install Ruby Gems RubyGems is a package management framework for Ruby


  • Download Gems :  http://rubygems.org
  • Extract to C: RubyGems
  • If in Step 1 you use the installer, you can click 2x the file C: RubyGems setup.rb
  • If Step 1 uses 7z file, you can open a command prompt, then type :
 C:Rubybinruby C:RubyGemssetup.rb


if you have intalled gems, you just  upgrade to the latest RubyGems:


  gem update --system


# may need to be administrator or root


Gem ready to used .


Step 3: Install Rails


At the command prompt, type :


  gem install rails


Yups, Ruby on Rails ready for used


Step 4: Install a Database Engine


Rails is completely DB-agnostic, so we’ll describe how to install two of the more popular Database Engines: SQLite and MySQL.


How to Install SQLite


SQLite is the default database type that Rails looks for, and it’s a great, lightweight DB for Development. We’ll install SQLite3 here.


You need two files from the SQLite download page:


  • the SQLite Command Line Tool
  • the SQLite DLL

Unzip them and put the three extracted files somewhere in your path or in the rubybin directory. Now install the sqlite3-ruby gem:


   gem install sqlite3-ruby


How to Install MySQL


Download MySQL Community Server and install it. If you also do PHP programming, check out WAMP for an easy installation as well.


To use MySQL in Rails versions greater than 2.1, you’ll also need the MySQL adapter:


  gem install mysql


Because MySQL is not the default adapter, we’ll have to edit our database.yml file later.

Setup a First Project


Note: Rails 3 is now installed by default; these instructions refer to Rails 3.


Setting a Rails project is a one-line affair (from the command prompt):


  rails new myprojectname


This will build a directory, in which it will build the entire blank Rails project skeleton. To see your fresh project in action, navigate to your project root and run scriptserver:


  cd myprojectname


  rails server


Then, navigate to http://localhost:3000/ in your browser, If everything went ok you should be now looking at the Ruby on Rails: “Welcome aboard default page” :


"Installing Ruby on Rails on Windows 7"