0

I am facing issue when I am trying to work with rails 3.0.11. I initially worked with rails 3.2.6. Build a prototype application in Rails 3.2.6, Ruby 1.9.2 and gem 1.8.7. But then found, server on which we need to host is a shared server which can only support Rails 3.0.11, Ruby 1.8.7 and gem 1.7.2.

Hence I want to keep my dev environment exactly same before I ran into further issues. As I found there was some discrepancy in routes.rb of both the versions.

Steps I followed:

  1. Uninstalled rails
  2. Uninstalled ruby
  3. Installed ruby from here.
  4. This installed ruby version 1.8.7-p370 and gem 1.8.7
  5. After this I installed rails by specifying version as 3.0.11

But still when I run command rails -v, it throws an error to me saying 'missing gem rails 3.2.6. Run bundle install to resolve the issue'

When I ran bundle install, it again completely installed rails 3.2.6 and problem remained unresolved.

Please suggest the clean way how shall I start my development on rails 3.0.11 without running into any issues?? Am I need to delete some registry or mapping in my system through which it is detecting rails 3.2.6 and creating issues??

Its urgent as I need to complete my dev by 7th September.

As I am new to stackexchange, please guide is it appropriate to ask question on the same related thread or shall I open new discussion for my problem?

Gun
  • 61
  • 1
  • 9
  • Did you change your Gemfile to reference rails version '3.0.11'? – Krista Aug 30 '12 at 15:22
  • 2
    In addition to checking your Gemfile, you can run `gem list` to be sure rails 3.2.6 isn't being referenced. When you run the rails command, it will always run on the newest version installed. That's where `bundle exec rails` can come in handy. – agmcleod Aug 30 '12 at 15:46
  • Gemfile in my project? I did not change my gem file. on running 'gem list rails', it shows rails 3.0.11 only. But when I run rails -v, it asks to run bundle install command. Gemfile is required to change in project, but initially rails command should run properly first :| – Gun Aug 30 '12 at 17:09
  • Again stucked :((..able to install rails 3.0.11. But it runs in the command window in which I install. When I open new command window or open from eclipse terminal with aptana studio plugin, it gives me the error: ←[31mCould not find i18n-0.6.0 in any of the sources←[0m ←[33mRun `bundle install` to install missing gems.←[0m...This means I need to have rails 3.2.6...why is this coming??? how to resolve it?? I don't have rails 3.2.6 installed? Is it because of gem version?? – Gun Aug 30 '12 at 18:43

5 Answers5

1

You should check also remove your Gemfile.lock or manually 'bundle update rails' when you change your rails dependency.

John Paul Ashenfelter
  • 3,035
  • 1
  • 20
  • 29
  • able to install rails 3.0.11. But it runs in the command window in which I install. When I open new command window or open from eclipse terminal with aptana studio plugin, it gives me the error: ←[31mCould not find i18n-0.6.0 in any of the sources←[0m ←[33mRun bundle install to install missing gems.←[0m...This means I need to have rails 3.2.6...why is this coming??? how to resolve it?? I don't have rails 3.2.6 installed? Is it because of gem version?? – Gun Aug 30 '12 at 18:45
1

@Gun - please note in response to one of your comments posted above - you DO need to change your Gemfile - if you are running rails -v from withing your project's directory, it will read the Gemfile.

There is a script located at script/rails - this is what runs when you run the rails command from the project directory. NOTE that this rails script requires your config/application.rb file - which in turn reads the Gemfile and bundles the referenced gems. Thus is your Gemfile still references 3.2.6, and it is not installed, rails -v will not work

Glad to hear the problem is fixed :)

As for the asset pipeline - if you are using rails 3.2.6 (or were using it) then you may have been using the asset pipeline to serve your assets (javascript files, CSS files, images, etc). If you were, and you downgrade to anything pre rails version 3.1, then anything being served through the asset pipeline will no longer work.

Here is a pretty good description of the asset pipeline: http://guides.rubyonrails.org/asset_pipeline.html

Krista
  • 865
  • 1
  • 6
  • 15
0

I suggest to use rbenv or rvm to create a virtual environment/sandbox where you can install your preferred ruby versions (e.g. 1.8.7) and keep tracking of your dependencies separately. This would save you a lot of effort.

Keep in mind that rails 3.0 has no asset pipeline support (it has been included in rails 3.1)! This is a very important difference and if you depend on it you will have big issues to solve for the downgrade.

alup
  • 2,701
  • 1
  • 19
  • 12
0

Thanks a lot everyone for help.

I believe it was weird issue. I had heroku on the system. I was initially deploying my app on the same and then changed to another hosting server. After uninstalling the heroku, it works perfectly fine. Probably, that was interfering somewhere. Although, not sure but problem is resolved.

Thanks a lot again for a great great help!!!

Meanwhile, I would request alup to throw some more light on asset pipeline support. Wots that? Could you please explain more??

Gun
  • 61
  • 1
  • 9
0

Need to delete C:\Users\.ror folder and C:\Users\.gemfile and C:\Users\.gemfile.lock from your desktop..

Gun
  • 61
  • 1
  • 9