If I use devise, or any other plugin for that matter, what are the best practises for updating it when its in my rails 3 app?
I know devise allows you to modify things, how will this work?
in rails 3 you should most likely be managing everything through your Gemfile and bundler. You would update and maintain your gems through bundler. http://gembundler.com/
Related
Under Rails 2 projects doesn't have the gemfile.
In this case which is the best way to manage the gems?, which gems should I vendor? also I will like to know if there's another way to manage this?
You can manage gem using bundle in rails 2.3 app ,you can refer
http://gembundler.com/rails23.html
http://yehudakatz.com/2009/11/03/using-the-new-gem-bundler-today/
I'm trying to setup Bundler with Rails 2.3.10 to make the transition to Rails 3 easier. But I'm not sure what the instruction on this page means. Am I supposed to require all the gems that I'm using in my app? If so, where? Thanks for reading.
Use the Rails 2.3 tutorial http://gembundler.com/rails23.html it's better on your case.
The setup made all requirement of all gem in your Gemfile. He avoid to do a lot of require ''.
What is the best practice when creating a rails project
1 - is it good to use ruby gems
2 - or is it good to use ruby plugins (as almost all the gems has their plugin versions)
and what are the strengths and weaknesses of eachoption
consider we are creating the rails project with rails 2.x.x or rails 3
thanks in advance
cheers,
sameera
I think you should have to go with gems if possible. You will have a rich framework with slim applications. If you use a lot of plugins your application will be too heavy. I'm talking from experience. I have an application with a lot of plugins in it and it is hell slow.
I prefer to use gems because then I can manage them with Bundler and it will install the necessary dependencies for me. It will also cache gems, which solves deployment issues.
Also, it isn't possible to use only plugins, there are always gem dependencies, and I'd rather use just one mechanism, so that's another point for gems.
I think that plugins are slowly turning into gems and Rails 3 is moving further in that direction.
In my case, I use gems whenever I can but I do use plugins when I don't have access to gems on the host.
For example, Heroku doesn't have all the gems and neither does Media Temple. Since plugins are imported with the project, you can get away with it :)
I have developed a simple library in Ruby and need to use this in several Rails applications (some of which are not built yet). What is the best way to easily add this Ruby library to several Rails applications as and when required? Our team is running Ubuntu and our repository is Mercurial.
Should I use a...
Rails plugin? This would be my first
choice but it appears not to support
Mercurial??
Ruby Gem?
Custom Rake script?
Other options??
Any pointers would be much appreciated!
Ruby already has an established mechanism for code sharing i.e. RubyGems. Jeweler makes Gem creation easy. I'd recommend that you check it out.
Make a gem or a plugin. Gems are better in my opinion, easier to manage.
My rule of thumb:
If it doesn't depend on rails, make it a gem.
If it depends on rails, make it a plugin.
Make a Rails plugin. It doesn't "support" Mercurial in the sense that you can't do script/plugin install $REPO_URL and have it work automatically, but if it's for your own use, then you won't miss that feature.
I'm starting work on a project using Rails, but I'm waiting for the 3rd edition of the pragmatic rails book to come out before I purchase a book.
Anyway, my question is a bit more pointed than how do I get started...
What are some of the must have gems that everyone uses?
I need basic authentication, so I have the restful authentication gem, but beyond that, I don't know what I don't know. Is there a run down of this information somewhere? Some basic setup that 99% of the people start with when starting a new rails application?
Thanks in advance.
The gems and plugins that I tend to use on most of my projects are:
Restful Authentication -- For authentication
Will Paginate -- For pagination
Attachment Fu -- For image and file attachments
RedCloth -- For textile rendering
Capistrano -- For deployment
For pagination, will_paginate.
This is very, very subjective because it all depends on what your application does! However, I've just had a look at the Gems I have installed and the one that absolutely does leap out as mandatory is Capistrano.
BTW Restful Authentication is a Rails plugin not a Gem.
HAML is a must have. You'll never think of HTML in the same way again -- No more tag soup.
sudo gem install haml
sudo gem install ZenTest
rspec on rails
How can nobody have mentioned andand yet? It's the best thing since ||=
The only gems you need are:
Rails
Rake
If you "gem install rails" you'll get everything you need for Rails. You only need gems when you need them, so it's not worth worrying about before then.
EDIT: Actually there are a couple more you'll probably need:
mysql - or whatever Ruby database driver you need
mongrel - you don't necessarily need this until production, but it's nice to use in dev/test too
ZenTest - I use this mainly for "autotest" so that my tests run in a console window whenever my source files change
There could be many other gems that help you but we'd need more info from you to know if they're applicable, eg:
Web scraping (hpricot)
CSV (fastercsv)
Amazon S3 support (aws-s3)
Image manipulation (rmagick)
Graphing (gruff) - I use this as a plugin
Role-based security (role_requirement) - This one is a plugin too
mini_magick instead of rmagick.
Might want to keep an eye on: http://rubygems.org/ - you can see some interesting stats there re: most downloaded, most active, etc...
Also interesting and somewhat telling: https://github.com/languages/Ruby
This is a old thread but I thought I'll refine the list with what I believe to be must have gems at this point in time:
RSpec or Shoulda - tools for BDD/testing
factory_girl - fixture replacement
will_paginate - simple pagination
paperclip - image uploading/attachment
CanCan - authorization
Authlogic - authentication
HAML - templating engine