Rails Installation Error in ubantu12.04 - ruby-on-rails

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

Related

"Rails is not currently installed" Error

Hi i'm new to ruby on rails
I have 3 ruby version in my computer.
In a project i had to use rails 3.2.1 and ruby 1.9.2
So I switched using rvm use 1.9.2 in terminal. But after that my rails commands are not detected.
$ rails g model abc
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
Why is this happening? And how to solve this?
You may need to differentiate your gem set that contains that specific version of rails from the old ones.
rvm use 1.9.2#new_gem_set_of_yours --create --default
And then retry installing the 3.2.1 rails
gem install rails --version 3.2.1
Or specify the new rails version in your Gemfile and let Bundler take care of it
gem 'rails', '3.2.1'
and run bundle install.
Type in your terminal
gem install rails -v 3.2.1
if it does not work, first try
rvm install 1.9.3
then
rvm rubygems current
and repeat.

Issue with Rails after RVM installation

I had the Rails 3.2.9 installed before I did the following.
I installed RVM using the command 'curl -L https://get.rvm.io | bash -s stable --ruby' referring https://rvm.io/rvm/install/
Then ruby 1.8.7 and 1.9.3 were installed using command rvm install [x]' ([x] stands the version) and I set ruby 1.9.3 as default using the command 'rvm use 1.9.3 --default'. Earlier I was using '1.8.7' which was installed before installing RVM. Now when I type 'rails -v' in the command prompt I am getting the following error.
/usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:247:in
to_specs': Could not find railties (>= 0) amongst [bundler-1.2.3,
rake-10.0.2, rubygems-bundler-1.1.0, rvm-1.11.3.5] (Gem::LoadError)
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/dependency.rb:256:into_spec'
from /usr/lib/ruby/vendor_ruby/1.8/rubygems.rb:1208:in `gem'
from /usr/local/bin/rails:18
Please help me to resolve the same. Good responses will always be appreciated.
since you are using rvm you need to install rails 3.2.9 before doing rails -v try this command
gem install rails -v 3.2.9
and then try rails -v
From the Question itself it is known that the issue is with some of the gem dependencies. So after setting up RVM, I updated the gems and installed rails using gem command once again. Then restarted the terminal. Wow, It works!! 'rails -v' outputs Rails 3.2.9.
One more thing I want to tell you that if you are using bash, just execute the command '/bin/bash --login' before setting the default ruby version. Otherwise it will throw the error shown below.
'RVM is not a function, selecting rubies with 'rvm use ...' will not work.'
Thanks for all your responses.
Try passing --default to set the default ruby version
rvm use 1.9.3 --default

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.

Rails not installing when following documentation

$ sudo gem install rails
Successfully installed rails-3.1.1
1 gem installed
Installing ri documentation for rails-3.1.1...
Installing RDoc documentation for rails-3.1.1...
This did not properly work, as when I run rails, I get
The program 'rails' is currently not installed. You can install it by typing: sudo apt-get install rails
And doing ruby --version gives
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
and doing which rails returns nothing. Anyone have any ideas about how I would go about installing the latest version of Rails? I've tries using the apt-get method, but I got Rails 2, however I need Rails 3 for my purposes.
I've had the similar problem with my Ubuntu installation.
Solved it following to steps:
Make sure rubygems is installed
created the following symlink:
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

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.

Resources