Just a quick update..
My future blog posts will be posted in http://blog.budiharso.info
I’ll see you there :D
Just a quick update..
My future blog posts will be posted in http://blog.budiharso.info
I’ll see you there :D
So I was outputting URL from a rails model with
Rails.application.routes.url_helpers.something_url(id)
but my specs were complaining with
Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true
after some googling and trial and errors I found that this line would did the trick. Put it in your test_helper or spec_helper
Rails.application.routes.default_url_options[:host] = 'localhost:3000'
cheers :D
This is just a reminder for myself, I finally can run autotest with this setup on my mac:
Gemfile content:
snip ... group :development, :test do gem 'webrat' gem 'mocha' gem 'ZenTest' gem 'autotest-rails' gem 'autotest-growl' gem 'autotest-fsevent' end
RAILS_ROOT/.autotest (create one if it doesn’t exist) content:
require "ZenTest" require "autotest/rails" require "autotest/growl" require "autotest/fsevent" Autotest.add_hook :initialize do |autotest| %w{.git .svn .hg .DS_Store ._* vendor tmp log doc config .rvmrc Gemfile .autotest README Rakefile}.each do |exception| autotest.add_exception(exception) end end
then go to your RAILS_ROOT directory, run bundle exec autotest, and watch those nice green growl pops up :D
UPDATE: RailsInstaller 2 has been released. It include ruby 1.9.2 and rails 3.1, read it here and download it here.
Railsinstaller from railsinstaller.org ships with ruby 1.8.7 by default, but if you want to use ruby 1.9.2, these steps might help you out.
And that’s it, now you can enjoy railsinstaller with ruby 1.9.2 :D
I just upgrade my rails application to rails 2.3.10 because of this post, my application is using paperclip and by that time it was using paperclip 2.3.4, and on rails 2.3.9 everything is going well. But as soon as I upgraded to rails 2.3.10 when I run ./script/server I got this error:
=> Booting Mongrel => Rails 2.3.10 application starting on http://0.0.0.0:3001 /Library/Ruby/Gems/1.8/gems/activesupport-2.3.10/lib/active_support/dependencies.rb:466:in `load_missing_constant': uninitialized constant Paperclip::Glue (NameError)
After googling a while, none of the results was involving rails 2.3.10, but most of the answers suggesting to install paperclip version 2.3.1.1, so I think I’ll give it a try. So I change the line in my Gemfile to gem ‘paperclip’, ‘~> 2.3.1.1’, and then I run bundle install, after that I try to run ./script/server, and it run!
Ok, basically I have just clone this rails 2.3.8 app which use bundler, and it told me to do “bundle install”, so I did, and it run without any problem, so far so good. After ‘bundle install’ finished successfully I try to run ‘rake db:create’ and it throws this error message :
Missing the Rails 2.3.8 gem. Please `gem install -v=2.3.8 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
I said, WTF? I do have rails 2.3.8 installed, in fact I’ve been using it for a while without any problem, so why is this new app cannot find it? google to the rescue! I found this post from heroku that explain the problem, and one of the solution is to add the Rails 2.3.8 gem to your gem manifest or Gemfile, so I did. Put this in your Gemfile just after the line that says ‘source :rubygems’
source :rubygemsgem 'rails', '2.3.8'
After that I try to run ‘rake db:create’ again, and it works! that’s another trick in my rails arsenal :)
Tudulis which originally written with PHP and CakePHP is now have its clone. Meet rtudulis, just like tudulis it’s a web-based, free, todo list and tasks management application and most importantly it is written with Ruby on Rails instead, how cool is that? :D
The reasons behind why I created rtudulis are mainly to get to know about rails application deployment process (using capistrano). With the creation of this rails app I have to deal with capistrano and its several deployment strategies which I don’t have any experience before. And just like tudulis, the source code for rtudulis is available on my github repository in case anybody want to use it. Currently it doesn’t have all the feature of tudulis (PDF creation and twitter login) since it’s still under development, but if you want to try out the live application, you can go to http://r.tudulis.com and try it out.
Well, that’s all for now, happy forking! :D
Some screenshots :