How to Run Rails 2.3.8 - ruby-on-rails

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.

Related

Rails Installation Error in ubantu12.04

I have already installed Ruby 1.9.3,gem 1.8.24, using RVM in ubantu 12.04. But when I instll rails using gem using command gem install rails , then rails is installed with following message:Successfully installed rails-3.2.6
1 gem installed
Installing ri documentation for rails-3.2.6...
Installing RDoc documentation for rails-3.2.6...
But when I check the version of rails then following error occurThe program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
I need help. Thank you?
rvm use 1.9.3 --default
gem install rails
Then run rails -v
Try this:
run this command
source /etc/profile
Then, run rails -v
First try with
rvm list
to get all ruby version then run following cmd to set one of ruby as default
First you have to set
rvm use 1.9.3 --default
Then try cmd
rails -v

RVM won't install Rails to system

I've tried the following commands:
rvm system gem install rails
rvm system install rails
rvmsudo gem install rails
sudo gem install rails
After one of these commands, I get a message telling me to run sudo gem install rails. But it doesn't work.
I had no problems before to install rails on rvm 1.9.2 the Mac OSX 10.6.8 version.
Could anyone help me with that?
If you've installed rvm successfully, test with rvm info so that it returns output then you just need to do gem install rails to install rails into the ruby version you are using with RVM - no sudo required. Have I misunderstood?
First check either rvm install properly or not using this command
rvm --help
then install rails by this command
gem install rails -v=3.2.1
Or any version you want..
If you don't have ruby 1.9.3 then use:
$ rvm install 1.9.3
or you may start from this:
$ rvm use 1.9.3
$ rvm gemset create rails313
$ rvm use 1.9.3#rails313 --default
$ gem install rails -v 3.1.3
note: I use 1.9.3 as an example you can use other ruby version also.
Follow the documentation. Make sure you've got the necessary system requirements via rvm requirements. Unless you've got some bizarre user permissions in $HOME, there is no reason to use sudo w/ rvm on your system.
make sure you have installed build_essentials, also try rvm requirements, which gives all dependencies, install all using rvmsudo command
See also: Installing Ruby on Rails - Mac OS Lion
First check whether all dependencies are satisfied by running:
$ rvm requirements
next:
$ rvm install ruby
next:
$ gem install rails
Note: You may have to use sudo or rvmsudo before the commands depending on whether its system-wide install or user specific.

ruby on rails install help

So I run this command successfully: sudo gem install rails
It outputs: Successfully installed rails-3.0.10
However, whenever I type in rails -v it shows: Rails 1.2.6
How can this be? Whenever I create a new project and do rails server, localhost:3000 doesn't work.
It's likely that your system has rails preinstalled, and the rubygems version is not overriding it.
You might have luck installing rvm and then installing rails within an rvm gemset.

Rails 2.3.8 problem

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.

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