<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3656918999061118095</id><updated>2024-08-29T15:10:33.065-07:00</updated><category term="rails"/><category term="attachment_fu"/><category term="installing"/><category term="share hosting"/><category term="upgrade"/><title type='text'>Working on Rails</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://workingrails.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://workingrails.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>aeperezt</name><uri>http://www.blogger.com/profile/10116236509615122931</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3656918999061118095.post-6020392911613251188</id><published>2009-11-30T06:49:00.000-08:00</published><updated>2009-11-30T06:49:25.963-08:00</updated><title type='text'>Active scaffold on ruby 1.8.7</title><content type='html'>If you have rails application 2.0.2 on ruby 1.8.6 and migrate your ruby to 1.8.7, but you have active scaffold working you will find some errors. So you need to change small code on active scaffold files. Here it goes&lt;br /&gt;
&lt;br /&gt;
look for the file view_helper.rb&lt;br /&gt;
&lt;br /&gt;
and change this line&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;span class=&quot;iv&quot;&gt;@params_for&lt;/span&gt;[&lt;span class=&quot;sy&quot;&gt;:controller&lt;/span&gt;] = &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt; + &lt;span class=&quot;iv&quot;&gt;@params_for&lt;/span&gt;[&lt;span class=&quot;sy&quot;&gt;:controller&lt;/span&gt;] &lt;span class=&quot;r&quot;&gt;unless&lt;/span&gt; &lt;span class=&quot;iv&quot;&gt;@params_for&lt;/span&gt;[&lt;span class=&quot;sy&quot;&gt;:controller&lt;/span&gt;].first(&lt;span class=&quot;i&quot;&gt;1&lt;/span&gt;) == &lt;span class=&quot;s&quot;&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&#39;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;c&quot;&gt;# for namespaced controllers&lt;/span&gt;

&lt;/pre&gt;&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; @params_for[:controller] = &#39;/&#39; + @params_for[:controller] unless @params_for[:controller].chars.first == &#39;/&#39; # for namespaced controllers&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And you are done it works.&lt;br /&gt;
&lt;br /&gt;
good luck.</content><link rel='replies' type='application/atom+xml' href='http://workingrails.blogspot.com/feeds/6020392911613251188/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://workingrails.blogspot.com/2009/11/active-scaffold-on-ruby-187.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/6020392911613251188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/6020392911613251188'/><link rel='alternate' type='text/html' href='http://workingrails.blogspot.com/2009/11/active-scaffold-on-ruby-187.html' title='Active scaffold on ruby 1.8.7'/><author><name>aeperezt</name><uri>http://www.blogger.com/profile/10116236509615122931</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3656918999061118095.post-6103735155010146555</id><published>2009-11-21T16:51:00.000-08:00</published><updated>2009-11-21T16:52:21.292-08:00</updated><title type='text'>Compile Ruby 1.8.7-p174, on fedora 12</title><content type='html'>There is just one issue when compiling ruby on Fedora 12, and it has to do with openssl, ruby 1.8.7-p174 works fine with openssl 0.98 but not with openssl 1.0, so you need to find openssl 0.98&amp;nbsp; from &amp;nbsp;http://www.openssl.org/source/openssl-0.9.8l.tar.gz&amp;nbsp;and compile it&lt;br /&gt;
tar xvzf openssl-0.9.8l.tar.gz&lt;br /&gt;
cd openssl-0.9.8l&lt;br /&gt;
./config&lt;br /&gt;
ls&lt;br /&gt;
make&lt;br /&gt;
make check&lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Then&amp;nbsp; configure your ruby like&lt;br /&gt;
./configure --with-openssl=/usr/local/include/openssl --with-openssl-dir=/usr/local/ssl&lt;br /&gt;
&lt;br /&gt;
now&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make test&lt;br /&gt;
if everithing is ok, then &lt;br /&gt;
make install&lt;br /&gt;
&lt;br /&gt;
Good luck.</content><link rel='replies' type='application/atom+xml' href='http://workingrails.blogspot.com/feeds/6103735155010146555/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://workingrails.blogspot.com/2009/11/compile-ruby-187-p174-on-fedora-12.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/6103735155010146555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/6103735155010146555'/><link rel='alternate' type='text/html' href='http://workingrails.blogspot.com/2009/11/compile-ruby-187-p174-on-fedora-12.html' title='Compile Ruby 1.8.7-p174, on fedora 12'/><author><name>aeperezt</name><uri>http://www.blogger.com/profile/10116236509615122931</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3656918999061118095.post-4052100245109785343</id><published>2009-10-21T18:56:00.000-07:00</published><updated>2009-10-21T18:59:15.308-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="attachment_fu"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><title type='text'>attachment_fu regenerate thumbnails</title><content type='html'>If you are using the attachment_fu plugin and for some reason you need to redo you thumbnails, then you need to know this definition that come as part of the pluging create_or_update_thumbnail(temp_file, file_name_suffix, *size)&lt;br /&gt;
&lt;br /&gt;
for example:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;On the console use the model &lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;blockquote&gt;prod=Product.find(:all) &lt;br /&gt;
&lt;br /&gt;
prod.each do | p| &lt;br /&gt;
&lt;br /&gt;
p.create_or_update_thumbnail(RAILS_ROOT +&#39;/public&#39;+p.public_filename,:thumb,&#39;300x300&#39;)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
That is it will redo your thumbnail, of cource you can use it as you want. Enjoy!</content><link rel='replies' type='application/atom+xml' href='http://workingrails.blogspot.com/feeds/4052100245109785343/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://workingrails.blogspot.com/2009/10/attachmentfu-regenerate-thumbnails.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/4052100245109785343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/4052100245109785343'/><link rel='alternate' type='text/html' href='http://workingrails.blogspot.com/2009/10/attachmentfu-regenerate-thumbnails.html' title='attachment_fu regenerate thumbnails'/><author><name>aeperezt</name><uri>http://www.blogger.com/profile/10116236509615122931</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3656918999061118095.post-5048327278957484174</id><published>2009-08-14T09:03:00.000-07:00</published><updated>2009-08-14T09:16:51.115-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="installing"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="share hosting"/><title type='text'>Rails on share hosting environment</title><content type='html'>If you have a share hosting provider and you want to deploy a rails apps  but you provider does not have rail on it or it has but not the specify rails version you require and you have ssh access to it, this steps may work for you&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt; Install ruby 1.8.7&lt;br /&gt;         download ruby from &lt;a href=&quot;ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz&quot;&gt;ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz&lt;/a&gt;&lt;br /&gt;         use   wget &lt;a href=&quot;ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz&quot;&gt;ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p174.tar.gz&lt;/a&gt;&lt;br /&gt;         extract files tar xvzf ruby-1.8.7-p174.tar.gz&lt;br /&gt;           change folder to ruby-1.8.7&lt;br /&gt;           cd ruby-1.8.7&lt;br /&gt;          change ruby configuration to install on the user folder&lt;br /&gt;            ./configure --prefix=$HOME&lt;br /&gt;             compile&lt;br /&gt;             make&lt;br /&gt;            make install&lt;/li&gt;&lt;br /&gt;   &lt;li&gt; Install ruby gems&lt;br /&gt;            download gems from &lt;a href=&quot;http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz&quot;&gt;http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz&lt;/a&gt;&lt;br /&gt;            wget &lt;a href=&quot;http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz&quot;&gt;http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz&lt;/a&gt;&lt;br /&gt;           extract files tar xvzf rubygems-1.3.5.tgz&lt;br /&gt;            change folder to cd rubygems-1.3.5&lt;br /&gt;            execute and install the gems&lt;br /&gt;            /home/tank/bin/ruby setup --prefix=$HOME&lt;br /&gt;           this variable export GEM_HOME=/home/tank/ruby/gems&lt;br /&gt;      (is best to set it on the user  enviroment)&lt;br /&gt;        you can do that adding it to your .bashrc or .bash_profile&lt;/li&gt;&lt;br /&gt;   &lt;li&gt; Install github if you need gems from github&lt;br /&gt;           download github from &lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/git-1.6.4.tar.gz&quot;&gt;http://www.kernel.org/pub/software/scm/git/git-1.6.4.tar.gz&lt;/a&gt;&lt;br /&gt;           wget &lt;a href=&quot;http://www.kernel.org/pub/software/scm/git/git-1.6.4.tar.gz&quot;&gt;http://www.kernel.org/pub/software/scm/git/git-1.6.4.tar.gz&lt;/a&gt;&lt;br /&gt;           extract tar xvzf git-1.6.4.tar.gz&lt;br /&gt;           configure to install on the user home&lt;br /&gt;          change to the git folder&lt;br /&gt;          cd git-1.6.4&lt;br /&gt;           ./configure --prefix=$HOME&lt;br /&gt;           make&lt;br /&gt;          make install &lt;/li&gt;&lt;br /&gt;  &lt;li&gt; Install you gems use like show here&lt;br /&gt;           $HOME/bin/gem &lt;tt&gt;gem sources -a &lt;a href=&quot;http://gems.github.com/&quot;&gt;http://gems.github.com&lt;/a&gt;&lt;/tt&gt;&lt;br /&gt;           $HOME/bin/gem install mongrel&lt;br /&gt;           $HOME/bin/gem install rails -v 2.3.2&lt;br /&gt;           $HOME/bin/gem install mysql&lt;/li&gt;&lt;br /&gt;   &lt;li&gt; test your application   &lt;blockquote&gt;     go to you application folder and run  &lt;/blockquote&gt; &lt;blockquote&gt; $HOME/bin/ruby script/server&lt;br /&gt;6. to start the rails server you need to do this on your rails apps folder&lt;br /&gt;&lt;br /&gt;     &lt;/blockquote&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; to start and stop rails server do&lt;br /&gt;$HOME/ruby/gems/bin/mongrel_rails mongrel::start  -p 12004 --env=production -d    -l  log/mongrel.log&lt;br /&gt; $home/ruby/gems/bin/mongrel_rails mongrel::stop&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; the .htaccess file on the the folder of the domain must have this lines this will redirect any web request from port 80 (http) to the 12004 port where our rails server is running.&lt;br /&gt;  on this case the .htaccess file at $HOME/public_html/railsapps&lt;br /&gt;  RewriteEngine on&lt;br /&gt;&lt;br /&gt;  RewriteCond %{HTTP_HOST} ^mysite.com$ [OR]&lt;br /&gt;  RewriteCond %{HTTP_HOST} ^&lt;a href=&quot;http://www.windward.tanklevel.info/&quot;&gt;www.mysite.com&lt;/a&gt;$&lt;br /&gt;  RewriteRule ^/?$ &quot;http\:\/\/127\.0\.0\.1\:12004%{REQUEST_URI}&quot; [P,QSA,L]&lt;br /&gt;  RewriteRule ^(.*)$ &quot;http\:\/\/127\.0\.0\.1\:12004%{REQUEST_URI}&quot; [P,QSA,L]&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p style=&quot;margin-bottom: 0in;&quot;&gt; One thing if you server does not have rails you can run ruby commands like gems, rails, rake with no need of adding the $HOME variable and bin path.&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt; If you server has other version of ruby and rails then rake may not work it was not posible to make work so we have to relay on mysql command to create and load the application database.&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Also i&#39;m assuming you know or have the steps and gems require by your own rails apps.&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Hope this help you, if not then get a VPS, where you can rule the machine, and this steps also may help you installing you ruby and rails but you need to consider not use mongrel and use passenger and not to use –prefix=$HOME when compiling.&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;margin-bottom: 0in;&quot;&gt;Good luck.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://workingrails.blogspot.com/feeds/5048327278957484174/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://workingrails.blogspot.com/2009/08/rails-on-share-hosting-environment.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/5048327278957484174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/5048327278957484174'/><link rel='alternate' type='text/html' href='http://workingrails.blogspot.com/2009/08/rails-on-share-hosting-environment.html' title='Rails on share hosting environment'/><author><name>aeperezt</name><uri>http://www.blogger.com/profile/10116236509615122931</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3656918999061118095.post-7015397925741276422</id><published>2009-01-11T18:40:00.000-08:00</published><updated>2009-01-11T18:41:02.207-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="upgrade"/><title type='text'>Upgrade to Rails 2.2.2</title><content type='html'>When you have  work on an application on you favorite language or framework, it is always good to know the new features of new release of it. But it is not always easy to migrate all your work and effort to the new version, so for all of you who have done something on rails 2.0 here are some pointer to upgrade to rails 2.2.2&lt;br /&gt;&lt;br /&gt;If your application is simple rails with no plugin or gems require the upgrade is simple:&lt;br /&gt;&lt;br /&gt;First you need to upgrade you rails version, rails 2.2.2 require gems version 1.3.0, therefore you need to verify you gems version first to do so gem -v command to see the gems version, if you have gems version 1.3.0 or higher you are ready if not the you need to update your gem first, that can be accomplish by executing&lt;br /&gt;&lt;br /&gt;gem update  - - system &lt;br /&gt;&lt;br /&gt;as root or &lt;br /&gt;&lt;br /&gt;sudo gem update - - sytem&lt;br /&gt;&lt;br /&gt;If that does not work, then you can download the gem code http://rubyforge.org/frs/?group_id=126 and do a manual upgrade. Once you have the right gems version you can do upgrade your gems by the command line:&lt;br /&gt;&lt;br /&gt;gem update  or sudo gem update&lt;br /&gt;&lt;br /&gt;This will update all your installed gems including rails and its requirements.&lt;br /&gt;&lt;br /&gt;Then on you rails application path type &lt;br /&gt;&lt;br /&gt;rake rails:upgrade&lt;br /&gt;&lt;br /&gt;This will update your rails application with the new rails version&lt;br /&gt;&lt;br /&gt;Now you need to change your enviroment.rb file and change the rails version line from &lt;br /&gt;&lt;br /&gt;RAILS_GEM_VERSION = &#39;2.0.2&#39; unless defined? RAILS_GEM_VERSION&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;RAILS_GEM_VERSION = &#39;2.2.2&#39; unless defined? RAILS_GEM_VERSION&lt;br /&gt;&lt;br /&gt;When done you can start you server on development and see you application running with rails 2.2.2&lt;br /&gt;&lt;br /&gt;If you have plugins you need to test and see if everything works as expected, some plugins like filecolum will break, giving you this error NameError (uninitialized constant FileColumn::ClassMethods::Inflector): it can be fixed by modifing the file file_column.rb from:&lt;br /&gt;Inflector.underscore(self.name).to_s,&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;Activesupport::Inflector.underscore(self.name).to_s,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In active_merchand you need to comment out the infletor part of  the file active_merchant/lib/active_merchant/billing/integrations.rb&lt;br /&gt;In liquid you need to chage the ini.rb file to &lt;br /&gt;&lt;br /&gt;ActionView::Base::register_template_handler :liquid, LiquidView &lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;ActionView::Template::register_template_handler :liquid, LiquidView    &lt;br /&gt;&lt;br /&gt;If you have will_paginate as a plugin then you will have to remove it and use the gem version instead.&lt;br /&gt;&lt;br /&gt;If you have started this project with rails 1.2.X and have used the pagination you will need to install classic_pagination plugin, but you will have to change this lines in order to make it work on rails 2.2.2&lt;br /&gt;the file is pagination.rb&lt;br /&gt;from&lt;br /&gt;      options[:singular_name] ||= Inflector.singularize(collection_id.to_s)  &lt;br /&gt;      options[:class_name]  ||= Inflector.camelize(options[:singular_name]) &lt;br /&gt;to&lt;br /&gt;      options[:singular_name] ||= ActiveSupport::Inflector.singularize(collection_id.to_s)         options[:class_name]  ||= ActiveSupport::Inflector.camelize(options[:singular_name]) </content><link rel='replies' type='application/atom+xml' href='http://workingrails.blogspot.com/feeds/7015397925741276422/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://workingrails.blogspot.com/2009/01/upgrade-to-rails-222.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/7015397925741276422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3656918999061118095/posts/default/7015397925741276422'/><link rel='alternate' type='text/html' href='http://workingrails.blogspot.com/2009/01/upgrade-to-rails-222.html' title='Upgrade to Rails 2.2.2'/><author><name>aeperezt</name><uri>http://www.blogger.com/profile/10116236509615122931</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>