1

I am attempting to install Rails 4.0.0 as per the tutorial, but am getting the following error:

gez@akira:~$ gem install rails --version 4.0.0 --no-ri --no-rdoc
Fetching: i18n-0.6.4.gem (100%)
Successfully installed i18n-0.6.4
Fetching: multi_json-1.7.7.gem (100%)
Successfully installed multi_json-1.7.7
Fetching: tzinfo-0.3.37.gem (100%)
Successfully installed tzinfo-0.3.37
Fetching: atomic-1.1.10.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

/home/gez/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
creating Makefile

make
compiling atomic_reference.c
linking shared-object atomic_reference.so

make install
/usr/bin/install -c -m 0755 atomic_reference.so /home/gez/.rvm/gems/ruby-2.0.0-p247@railstut_rails_4_0/gems/atomic-1.1.10/lib/home/gez/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/x86_64-linux
/usr/bin/install: cannot create regular file `/home/gez/.rvm/gems/ruby-2.0.0-p247@railstut_rails_4_0/gems/atomic-1.1.10/lib/home/gez/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/x86_64-linux': No such file or directory
make: *** [install-so] Error 1


Gem files will remain installed in /home/gez/.rvm/gems/ruby-2.0.0-p247@railstut_rails_4_0/gems/atomic-1.1.10 for inspection.

It appears that two paths have become merged, but being new to Rails / Ruby I am unsure how to proceed. All previous steps appear to have completed successfully without errors.

My system is Linux Mint x86_64 (Debian based).

gezpage
  • 441
  • 4
  • 11

5 Answers5

6

It looks like Rails 4.0 needs RubyGems 2.0.3, so the command

gem update --system 2.0.3

should work. I've updated the tutorial accordingly.

mhartl
  • 1,931
  • 1
  • 13
  • 16
2

Had pretty much the same problem, posted an answer to this question on how I finaly got it to install.

Basically :

  • gem update --system (updated me to 2.0.3)
  • gem update
  • gem install rails (without the version, 4.0.0 seems to be the default now)

Good luck

Community
  • 1
  • 1
V.Coss
  • 176
  • 1
  • 5
1

I had this exact same problem today. I was able to fix it, but I'm not entirely sure what caused the problem initially, or even how I solved it.

What I do know is it finally worked after I updated ruby gems to the latest version, instead of getting version 2.0.0 as the tutorial suggests.

gem update

instead of

gem update --system 2.0.0

Try that and let me know if it helps.

  • Thanks for the reply, when I run gem update I get a similar error but this time complaining about "Error installing json" although it does appear to complete. Same problem when trying to install rails though. – gezpage Jun 28 '13 at 09:11
  • My next suggestion it to install JRuby. During a quick glance of the rakefile for atomic-1.1.10, it shows that if JRuby is installed, the gem will install using a different (preferred) method. I would recommend installing it using home brew. – Travis Hairfield Jun 28 '13 at 22:13
0

if you are install ruby/rails through rvm, always run

rvm requirements

after you installed rvm, before you try install ruby and rails

fengd
  • 7,551
  • 3
  • 41
  • 44
0

try

gem install rails --no-ri --no-rdoc

Without the version, it's going to install the latest version of rails, at this time rails 4.0.0. Why you don't have the documentation???

Also you could try this

Jean
  • 5,201
  • 11
  • 51
  • 87