tale852150
tale852150

Reputation: 1628

Rails will not install on CentOS 6.5

CentOS 6.5 Ruby 1.9.3 RubyGems 1.8.24

Can not install Rails (logged in as 'root'). I get the following error:

ERROR: Loading command: install (LoadError) cannot load such file -- zlib ERROR: While executing gem ...(NameError) uninitialized constant Gem::Commands::InstallCommand

yum install zlib shows packaged installed already and latest version

Any help would be appreciated...

Upvotes: 1

Views: 3713

Answers (2)

tale852150
tale852150

Reputation: 1628

http://imbaprogramming.blogspot.com/2013/11/installing-ruby-on-rail-on-centos-6-64.html

The above is the best set of instructions I have found for installing Ruby, Gems, Rails and Sqlite. Just one typo error but all else worked well for me on CentOS 6.5.

The typo is where the instructions say to 'Install the sqlite-ruby'. The command should read:

gem install sqlite3-ruby

Also, I found that nodejs is needed in order to start the rails server. If missing you will get a JavaScript runtime error when trying to start the rails server.

yum install nodejs

HTH

Upvotes: 2

ironsand
ironsand

Reputation: 15151

You should install necessary libraries before installing ruby.

try yum install gcc-c++ glibc-headers openssl-devel readline libyaml-devel readline-devel zlib zlib-devel

Then try rebuild ruby.

I recommend you to use rbenv and ruby-build plugin for rbenv. https://github.com/sstephenson/rbenv https://github.com/sstephenson/ruby-build

Upvotes: 1

Related Questions