Running rails 3.0 project on rails 3.1 machine - ruby-on-rails-3

I have installed rails 3.1 on my system but currently I have to work on rails 3.0 project. How can I run it. Otherwise it suggests me to use bundle exec for every command.
Secondly, it is showing me the following error :-
Command 'exiftool' not found.
How to get rid of these errors. Please guide.
Thanx.

Command 'exiftool' not found.
Upgrading to Rails 3.1 (screencast, first few minutes if you don't need Asset Pipeline)
Consider using RVM. With this thingumajig you can have different gemset (including rails, rusty and shiny) and even ruby version for each of your applications. Start from here.

Related

Why are development style sheets and devise logout not working?

I have a 3.2.8 Rails application which has been deployed into production and is running just fine. While preparing to code an enhancement I pulled fresh code from the SVN and started up a development version of the application and found the stylesheets were non functional and the Devise logout did not work in DEVELOPMENT.
All other aspects of the application work exactly as they should.
I've been reading many stack over flow Q & A and cannot figure this out.
Then I realized the default version of Ruby did not match the version for the application.
The application was built with ruby 1.9.3 p286 and my machine boots up in Ruby 2.1.0
solution:
stop the server
rvm use ruby-1.9.3-p286
bundle install
rails server
= good to go.

Rails not found in specific rails project folder

I've installed rails using rvm. I've loaded rvm using ~/.bahsrc.
rails is working fine.
which rails
/home/user/.rvm/gems/ruby-2.1.0/bin/rails
but in that rails project folder which command says
/home/dinesh/.rvm/gems/ruby-2.0.0-p353#something/bin/rails
How's this happening? How to make my rails work in that folder?
If you are in the root of a rails project you may use
./script/rails --version # (or whatever rails command you want to call)
to be sure to use the rails version that corresponds to your project. Usually rails magic will apply inside a rails project and "happen" to find the correct version of rails, but there seems to be a number of things that can go wrong about that.

Issues with Rails3.0 vs Rails 3.1

So I finally upgraded (and then downgraded because of Unity) Ubuntu and reinstalled RVM but I'b stuck with rails 3.1 now, which is fine but all my old projects are in rails 3.0 and 3.1 has some incompatibilities. Off the top of my head RAILS_ROOT is now Rails.root (which all my projects use in someway), and I was having some issues with heroku when trying to upload a small rails 3.1 app I made to play around (since the PG gem wasnt in my gemlist I couldnt run migrations, and then installing the pg gem caused more issues).
So how do I install rails 3.0 again? I cant seem to find it in the repositories
And I know with gem sets I can install both right? Well if I do that, how do I create a new rails project? Which version of rails would use rails new new_app?
Ok, I understand what you need to do. I would highly recommend making a new Gemset using RVM, that way you can start from scratch and not worry about those things.
To do that, run this in your command line with RVM installed:
// EDIT THIS LINE TO MATCH WHAT YOU WANT
rvm use 1.9.2-or-which-ever-version-you-are-using#temporary_gemset --create
Once this gemset is created, it will be empty, so you can then proceed to install a younger version of rails, like so:
gem install rails -v 3.0.11 // (MAY NEED TO USE SUDO, DEPENDING ON YOUR SET UP)
This should install the older version of rails and its dependencies so that you can still edit and work with your older rails project. Check more of RVM's site for more help on switching between gemsets and creating them.
https://rvm.io//gemsets/
I would still recommend to figure out the differences eventually and move to the newer version for Rails, currently 3.2.5 because they are awesome. Here is some material to show you the differences and new features for when you do that later:
http://railscasts.com/episodes/265-rails-3-1-overview
http://railscasts.com/episodes/282-upgrading-to-rails-3-1
http://railscasts.com/episodes/318-upgrading-to-rails-3-2

What continuous integration servers work well with ruby on rails 3 and mac?

I am using a mac as the server. I need something that works well.
I wanted to use atlassian's bamboo but my attempts have failed. The latest doc I can find on the topic is an old blog post. http://blogs.atlassian.com/news/2009/05/bamboo_customer_8.html which helps very little and results in the error:
...rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:900:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
I looked at http://rubyforge.org/frs/?group_id=2918 which also appears to be years out of date.
So the question is, which Continuous integration server should I use for my rails 3 project, which I can run on a mac and use .rvm (today in 2011)?
Jenkins is always worked for me, you even have a OSX installer:
http://ingorichter.blogspot.com/2011/04/jenkins-osx-installer.html
CI Joe works fine for me with rails 3 and mac.
Jenkins also seems nice, though, as Ed_ mentioned. Especially the part about the OSX installer.
CruiseControl.rb is a CI written in Ruby and can be used for Rails projects.

How to use rspec_scaffold generator with latest rspec gem

I am a newbie to Rails 3 and Rspec. Kindly excuse my being a novice.
I am trying to use RSpec with Rails 3. I am using rails 3.0.3 and ruby 1.9.2 on ubuntu 10.04 os.
I am currently referring to the tutorial on :- http://www.railsfire.com/article/rspec-behaviour-driven-development-testing-framework. This tutorial not only uses old plugins , but old Rails version of 2.x also.
I am unable to use the old rspec generator ( rspec_scaffold ) with rspec 2.5 and rspec-rails 2.5 gem. As expected I get the following error as given below.
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$ rails g rspec_scaffold post title:string body:text
Could not find generator rspec_scaffold.
mohnish#mohnish-desktop:~/rails_testing/10Mar11/rspec_demo3$
Could you please tell me how should I give to accordingly for it to work for me using the above RoR configuration.
Thanks
The latest Rspec gems don't require the old generator mentioned above, basically on giving rails g in your rails app you would get all the list of generators with your app.
Thus, once you have installed the Rspec related gems, then give a rails g to your app, you need to basically run only one of the generator command from the modified list that you would get, which is rspec:install and this would be enough to get you up & running at least with a proof of concept(poc).