Hi I am new to Ruby on Rails and trying to setup in my machine [Ububntu 12.04 LTS]. I successfully installed Ruby and Gem now I am getting error while installing Rails
Here is my version of Ruby and Gem
$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
$ gem -v
2.1.7
Now when I try command $ sudo gem install rails or $ gem install rails
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read server session ticket A (https://rubygems.org/latest_specs.4.8.gz)
I looked this answer and updated the ca-certificate using $ sudo update-ca-certificates but it is still not working?
Help me as I new to RoR I have no idea what to do next since I have applied all measures I could. Thank you in advanced.
EDIT: Suggest me a way I can solve this problem, incase I don't find one I will be doing it using RVM.
Some packages may b missing. Try this.
rvm get head
rvm requirements run
rvm remove 1.9.3
rvm use 1.9.3 --install --default
gem install rails
I had this issue and simply had to update RubyGems
gem update --system
Most likely rubygems.org is down temporarily, try running this command to add one of the mirrors as source
gem source -a 'https://production.cf.rubygems.org'
and then run
gem install rails
There are some more mirrors available.
Without ssl:
$gem install rails --source http://rubygems.org
Related
Getting the following error when trying to install rails 3.0.1 with ruby gems
iHAL-2:~ $ gem install rails --version 3.0.1
ERROR: Could not find a valid gem 'rails' (= 3.0.1), here is why:
Unable to download data from https://rubygems.org/ - no such name (https://api.rubygems.org/specs.4.8.gz)
ERROR: Possible alternatives: rails
My setup of RVM should be okay:
iHAL-2:~$ rvm get stable
Downloading https://get.rvm.io
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz
Upgrading the RVM installation in /Users/iHal9000/.rvm/
RVM PATH line found in /Users/iHal9000/.profile /Users/iHal9000/.bashrc /Users/iHal9000/.zshrc.
RVM sourcing line found in /Users/iHal9000/.profile /Users/iHal9000/.bash_profile /Users/iHal9000/.zlogin.
Upgrade of RVM in /Users/iHal9000/.rvm/ is complete.
# iHAL-2,
#
# Thank you for using RVM!
# We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.
In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
Upgrade Notes:
* No new notes to display.
RVM reloaded!
iHAL-2:~ $ rvm osx-ssl-certs update all
Updating certificates for /usr/local/etc/openssl/cert.pem: Already are up to date.
iHAL-2:~ $ rvm rubygems latest
Rubygems 2.2.2 already available in installed ruby, skipping installation, use --force to reinstall.
I don't understand the difference but this worked for me:
gem install rails -v 3.0.1
I have problem with installing Rails 4. Hope you could help!
demo
$ rails -v
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.
demo
$ sudo gem install rails
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz)
The Best Solution for installing Rails is by Using Ruby Version Manager(RVM)
run curl -L https://get.rvm.io | bash -s stable to install RVM and the Install Ruby Using RVM by this Command rvm install 2.0.0 then Install Rails from this command
gem install rails -v 4.0.0
You can good to go then.
Had the same issue and everything is described here: http://railsapps.github.io/openssl-certificate-verify-failed.html
tl;dr Recent versions of RVM, the Ruby Version Manager, include a utility to diagnose and resolve errors caused by outdated certificate files. See the article Installing Rails for instructions and advice. The RVM website explains how to install RVM.
If you’ve installed RVM, try this:
$ rvm -v
# rvm 1.19.1 (stable)
$ rvm osx-ssl-certs status all
# Certificates for...
$ rvm osx-ssl-certs update all
# Updating certificates...
That’s all that is needed to resolve the issue if you are using RVM (you must be using RVM version 1.19.1 or newer).
I try to install skylinecms but I have a problem with installing the gem.
The gem factory_girl asked me to use version> = 1.9.2 of Ruby
atmoner#atmoner:~/base_ror$ sudo gem install skylinecms
ERROR: Error installing skylinecms:
factory_girl requires Ruby version >= 1.9.2.
ruby -v
atmoner#atmoner:~/base_ror$ ruby -v
ruby 1.9.3p286 (2012-10-12 revision 37165) [x86_64-linux]
I have tried to change ruby version to 1.9.2
atmoner#atmoner:~/base_ror$ rvm use 1.9.2
Using /home/atmoner/.rvm/gems/ruby-1.9.2-p320
But still same problem
atmoner#atmoner:~/base_ror$ sudo gem install skylinecms
ERROR: Error installing skylinecms:
factory_girl requires Ruby version >= 1.9.2.
what's the source of this problem?
you have an idea?
You shouldn't use sudo with rvm, as it creates a new subshell with a completely new environment. See more about sudo and rvm here: RVM and 'sudo'
Most likely your system ruby version is 1.8.7, and that is what is getting invoked when you run sudo gem install skylinecms. You can verify that with the following commands:
rvm use system
ruby -v
Try installing the skylinecms gem without sudo.
Best to use per-project gemsets as suggested in rvm best practices
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/
I've been poking around the internet looking for a solution on this one... with no luck..
I'm new to rails... If anyone has an idea, I'd love to hear it. Much appreciated!
I enter:
LW:src liamwright$ sudo gem install rails --include-dependencies
And Get:
INFO: `gem install -y` is now default and will be removed
INFO: use --ignore-dependencies to install only the gems you list
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR: could not find rails locally or in a repository
I am running:
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
Mac OS X 10.5.8
I also tried:
gem sources -r gems.rubyonrails.org
And Get:
source gems.rubyonrails.org not present in cache
Just to check...
...try doing a sudo gem update --system before installing Rails to make sure you have the latest RubyGems installed?
EDIT: Actually, if your RubyGems install is really old, you might need to follow the alternate directions on Gemcutter.
Might want to make sure you have the newest rubygems:
sudo gem install rubygems-update
sudo gem update --system
Then:
sudo gem install rails
I came across this solution on Albertux' blox. Running this script will fix it (It worked perfectly for me on an Ubuntu 9.10 machine):
#!/bin/bash
#(download the latest on http://rubyforge.org/frs/?group_id=126)
wget http://rubyforge.org/frs/download.php/43984/rubygems-update-1.3.0.gem
sudo gem install rubygems-update-1.3.0.gem
sudo update_rubygems
# now this work:
sudo gem update --system
echo "done."
I've just had the same problem trying to upgrade rubygems from 1.2.0 to 1.3.7.
Setp-1)
So I just downloaded rubygems-update-1.3.7.gem from http://rubyforge.org/frs/?group_id=126
Setp-2)
gem install rubygems-update-1.3.7.gem
Setp-3)
update_rubygems
and it work for me.