Rails 2.3.8 problem - ruby-on-rails

I am running Ruby 1.9.1 & rails 2.3.8. Everything is installed fine as far as I can tell but when I run rake db:migrate I get this error:
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.
So I wanted to make sure I had rails installed and ran from the command line rails -v & it says Rails 2.3.8. So I am not sure what gives here. Can anyone point me in the right direction? thank you very much.

Well, if you really have those versions installed and you get the error, something may be wrong.
But, you can do as the message recommends and comment out the setting in your config/environment.rb so it tries to use whatever version you have installed.

Did you install rails with a different package manager? If I install rails with "sudo apt-get install rails" then "rails -v" uses the rails binary in /bin (even if it's 2.3.5 or 2.0.2) because that is first in my path. If after that I install rails with "sudo gem install rails -v=2.3.8" typing "rails -v" still gives me the version of the /bin rails. I haven't verified, but I would guess this is the same issue if you're using macports. If you uninstall the package you installed with the non rubygems package manger and then reinstall rails with rubygems that may fix your issue.
Hope this helps.

Related

Getting Rails and mod_passenger to work under Debian with packages

I am running a Debian squeeze server with these (backported) packages installed:
rails 2.3.5-1~bpo50+1
rails-ruby1.8 2.3.5-1~bpo50+1
rake 0.8.7-1~bpo50+1
libapache2-mod-passenger 2.2.11debian-1~bpo50+1
I have a Rails application I am trying to run in this environment, but when I load the page I get this error message:
Actual load error: Could not find
RubyGem rails (= 2.3.5) Missing the
Rails 2.3.5 gem. Please gem install
-v=2.3.5 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.
There is a constraint that I must use these "official" Rails and mod_passenger Debian packages, so installing Rails and mod_passenger the traditional way via gems is not a possibility.
There is no real reason that you should have to use offical gems from debian. You get faster security updates by using rubygems or going for fullblown rvm.
However I would suggest commenting out the RAILS_GEM_VERSION in config/environment.rb and then it should use the version you have installed.
This seems to work:
ln -s /usr/share/rails-ruby1.8/ /usr/share/myrailsproject/vendor/rails

How to Run Rails 2.3.8

I have been working on installing Rails. However, I am ending up with 2.2.3 and I need 2.3.8.
What I did was I installed ruby via:
apt-get install ruby build-essential #installed 1.8.7
apt-get install rubygems #installed 1.3.6
gem install rails-v2.3.8
I tried to run this but it didn't work. Ubuntu didn't know the command, 'rails' in rails new blog.
I tried to remedy this by installing rails, not via gem but by apt-get:
apt-get install rails
The version installed was rails 2.2.3
What should I be doing to install Rails 2.3.8?
gem install rails -v 2.3.8 should do it. Rails 2 makes a project like "rails name_of_project", without the new keyword. Do a "gem list" to check whether Rails 2.3.8 is installed. If it is, it may be that rails is not in your path.
Edit:
I think that it would work if you add
"export
PATH=/var/lib/gems/1.8/bin:$PATH" to
your ~/.bashrc. I can't really verify
because i work on mac os, but i think
it would. Else, try to execute a "find /
-name "rails" to locate it and add that to your path.
You can install Ruby Version Manager and change version what you want.

problem with rails instalation need 2.3.8 after installation still getting "rails -v" = "Rails 2.3.5"

I'm trying to setup clockingit but...
even after
gem install -v=2.3.8 rails
1 gem installed
i'm getting
rails -v
Rails 2.3.5
I need 2.3.8 to rake the gems for clockingit
help greatly apreciated
Try gem install -v 2.3.8 rails (no equal sign). You should also check if the version of Ruby on Rails installed through RubyGems is used at all. Maybe a version of Ruby on Rails installed through the package management of your operating system overlaps the version installed through RubyGems.
Try to use rvm. It is dead simple to deal with, and makes managing gems very easy. If you already on rvm, try to create another gemset
rvm gemset create new_gemset
and the try to install rails

Error putting Instant Rails on Windows 7

I am trying to get my Instant Rails working on my Windows 7 laptop.
The error I keep getting when trying to access my site files are:
c:/rails/ruby/lib/site_ruby/1.8/rubygems.rb:779:in 'report_activate_error'
RubyGem version error: rack<1.1.0 not~> 1.0.1> <Gem::LoadError>
from c:/rails/ruby/lib/ruby.site_ruby/1.8/rubygems.rb:214:in 'activate'
from c:/rails/ruby/lib/ruby.site_ruby/1.8/rubygems.rb:1082:in 'gem'
from c:/depot/vendor/rails/actionpack/lib/action_controller.rb:34
from c://rails/ruby/lib/ruby.site_ruby/1.8/rubygems/custom_require.rb:31 in 'gem_original_require'
etc...
I have intalled Rubygems 1.3.7 and they work fine and when I run the test it works and the gem env shows that the 1.3.7 has been installed correctly.
What can I do to get this working?
Any prompt help would be VERY appreciated.
Thanks
Your rack gem is outdated. Try to run gem update rack. Or, if you use Rails with Bundler, just run bundle install in the root of your project and it will do everything for you.
I decided to write a little manual about the Ruby 1.8.7 and Rails stable installation.
Download RubyInstaller 1.8.7 from here. During the installation, check the 'Add Ruby executables to your PATH' box. After the installation, don't forget to restard cmd. Then try running ruby -v and gem -v to check for installed Ruby 1.8.7 and RubyGems 1.3.7;
Install the latest stable Rails 2.3.8 using gem install rails --no-ri --no-rdoc; Check it using rails -v;
Create a new application using rails myapp;
Test it: script/server. That's it!
gem install rack -v 1.0.1

Vanishing Ruby Gems

I'm using Ubuntu 8.10 and I installed Ruby and Ruby on Rails following the directions on this site. The exact directions I followed are no longer there as it appears the rubyonrails.org wiki has changed recently. But I installed it the long way. Installed Ruby, then Gems, then installed Rails using "gem install rails".
I haven't really messed with Rails for a while, and I tried to use the Gem command today and...
The program 'gem' can be found in the following packages:
* rubygems1.8
* rubygems1.9
Try: sudo apt-get install <selected package>
bash: gem: command not found
That's just weird to me because I installed rails using the gem command. I have been seaching my computer for the gems binary so I could create a link to it in the bin directory but I can't find it. I know it's installed becaues when I run 'script/server' and go to localhost:3000 in a browser I get the following version information:
Ruby version 1.8.7 (i486-linux)
RubyGems version 1.3.1
Rails version 2.2.2
Active Record version 2.2.2
Action Pack version 2.2.2
Active Resource version 2.2.2
Action Mailer version 2.2.2
Active Support version 2.2.2
Anyone know how I can get my gem command working again? Thanks for any help.
Note: I am new to Rails and fairly new to Ubuntu and Linux in general.
Did you install rubygems from apt-get? If yes, maybe you should try to remove it and install it from source.
Here is another article on installing Rails on Ubuntu:
http://www.rubyinside.com/how-to-install-a-ruby-18-stack-on-ubuntu-810-from-scratch-1566.html
Essentially, you can install Ruby from apt-get or source, but it's recommended to install rubygems from source.
You could look to see if it's in:
/usr/bin/gem1.8
if it is, then symlink /usr/bin/gem to it:
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
BTW, here's another tutorial on how to install rails on Ubuntu 8.10:
http://articles.slicehost.com/2009/1/6/ubuntu-intrepid-ruby-on-rails

Resources