Why won't my Ubuntu server install Rails 2.3.8? - ruby-on-rails

I have an older Ubuntu server with a Rails app running on version 2.3.5 that I'd like to move to version 2.3.8. The server doesn't seem to know that there is an update available, no matter how many times I run a "gem update" or "gem update --system" or "update_rubygems"
root#server:~# gem install rails -v 2.3.8
ERROR: could not find gem rails locally or in a repository
root#server:~# gem install rails
Successfully installed rails-2.3.5
1 gem installed
Installing ri documentation for rails-2.3.5...
Installing RDoc documentation for rails-2.3.5...
RubyGems 1.3.5 is installed.
I don't remember having to do anything special for any of my other servers when making this upgrade.
Any ideas?

Try:
gem install rails --source http://rubygems.org
with --source and without -v.

Related

I installed rails 6 beta, but I can't start my sample application

I installed rails 6 beta and I used rvm also.
gem install rails --pre
My Gemfile has:
gem 'rails', '~> 6.0.0.beta1'
When I try and run the rails using:
rails s
I get this error:
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem
pristine bindex --version 0.5.0 Ignoring bootsnap-1.4.0 because its
extensions are not built. Try: gem pristine bootsnap --version 1.4.0
Ignoring byebug-11.0.0 because its extensions are not built. Try: gem
pristine byebug --version 11.0.0 Rails is not currently installed on
this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
I already installed rails, so not sure why I am seeing this error?
The bundler of your current ruby version has an older version of rails installed.
So make these steps:
Check your current ruby version (ruby -v) and if its working together with rails 6 (requires ruby 2.5.0 or higher)
Install the new bundler in the ruby version (gem install bundler)
Install explicit rails 6 (for the ruby version with the new bundler) gem install rails
Run bundle install
Retry starting the server rails s
PS: If you want more than one ruby version on your system you should use rbenv or use Docker for the development.
Question: Your sudo command really needed? So your ruby is only accessible as root user? You overthink it :)

Ruby Version Confusion

Need a bit of help with installing Ruby and RoR
I installed everything initially last weekend (15/09/2012) including
Ruby, RoR and RubyMine. I've just opened a Command Prompt on my win 7
64bit box and ran:
$ rails --version
which to my surprise returned 2.3.14 as I was expecting to see 3.2.8
I then ran:
$ gem install rails
Which output:
Successfully installed rails-3.2.8
1 gem installed
Installing ri documentation for rails-3.2.8...
Installing RDoc documentation for rails-3.2.8...
Then running rails --version again still outputs 2.3.14
I'm a bit confused why a new install (following the instructions here
http://rubyonrails.org/download) seems to have installed a very old
version.
How do I get the latest version installed?
Thanks,
Sounds like you have both versions installed. Run "gem uninstall rails" and it will list the versions and ask which one you want to remove. Then chose the old one to remove.
I've gotten a bit further now. I ran:
F:\>gem cleanup rails
Cleaning up installed gems... Attempting to uninstall rails-2.3.14
You have requested to uninstall the gem:
rails-2.3.14
restful_authentication-1.1.6 depends on [rails (~> 2.3.4)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] y
Executables and scripts will remain installed.
Successfully uninstalled rails-2.3.14
Clean Up Complete
F:\>gem uninstall restful_authentication
Successfully uninstalled restful_authentication-1.1.6
F:\>gem install rails
Successfully installed rails-3.2.8
1 gem installed
Installing ri documentation for rails-3.2.8...
Installing RDoc documentation for rails-3.2.8...
F:\>rails -v
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb:317:in `bin_path': can't find ge
m rails ([">= 0"]) with executable rails (Gem::GemNotFoundException)
from C:/Ruby193/bin/rails:23:in `<main>'
So now it's telling me that it's installed rails successfully but now errors when I query it's version.

Cannot install rails gem

Somehow my rails installation hides itself successfully...
I have:
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
rvm 1.10.0-pre
gem 1.8.10
and I try to install rails:
sudo gem install rails
it works fine:
Successfully installed rails-3.1.3
1 gem installed
Installing ri documentation for rails-3.1.3...
Installing RDoc documentation for rails-3.1.3...
when I do:
rails - v
I get
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
Also, when I do
rake
in a rails app root directory, I get:
Missing the Rails gem. Please `gem install -v= 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.
executing
gem install -v= rails
raises an error:
ERROR: While executing gem ... (ArgumentError)
Illformed requirement ["="]
So apparently it is sitting somewhere and cannot be seen by my environment. I guess installing via apt-get is not an option as I don't want to confuse gem...
Any ideas?
Cheers
Mac
Do not use sudo.
Just gem install rails
Use RVM instead of the packaged ruby/gems distribution. http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

Fresh Rails install won't use version 3.1

I'm trying to install rails for the 1st time.
I can't seem to get it to install beyond Rails 2.2.3.
I have followed the instructions at:
http://rubyonrails.org/download
I downloaded the latest RubyGems and ran 'ruby setup.rb'.
$ gem -v
1.8.11
I ran 'gem install rails' and got Rails 2.2.3.
I ran 'gem update' several times and I get:
$ gem update
Updating installed gems
Updating rails
Successfully installed rails-2.2.3
Gems updated: rails
Installing ri documentation for rails-2.2.3...
Installing RDoc documentation for rails-2.2.3...
I tried gem1.8:
$ gem1.8 update
Updating installed gems
Updating rails
Successfully installed rails-2.2.3
Gems updated: rails
Installing ri documentation for rails-2.2.3...
Installing RDoc documentation for rails-2.2.3...
$ rails -v
Rails 2.2.3
$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i486-linux]
I'm using Debian 'unstable' (Wheezy/Sid).
I'm new to rails and don't understand what I'm doing wrong.
I've searched by so far nothing specific to this issue.
I thought the latsted gem would just get Rails 3.1
just as the install docs at the site say?
Any advise much appreciated.
Have you tried this ?
gem install rails --pre
I tried again and it worked fine now.
This time I pointed direct to the
fresh new copy of gem.
All good. Cheers!

Rails upgrade doesn't work

I'm using Ubuntu 10.10. When I run rails -v, I get 2.3.5. I want to upgrade to 3.0.5, so I run sudo gem install rails. I get
Successfully installed rails-3.0.5
1 gem installed
Installing ri documentation for rails-3.0.5...
Installing RDoc documentation for rails-3.0.5...
I run rails -v again. It still returns 2.3.5. I run sudo apt-get install rails, I get
Reading state information... Done
rails is already the newest version.
Anybody know what I'm doing wrong?
Look at your current gemfile, probably it has record only for rails 2.3.5, if it does then change to 3.0.5. After this just run bundle install

Resources