4

I've been following the guide here: http://spontaneousderivation.com/2012/09/30/rails-3-2-on-a-shared-dreamhost-server/ to get rails 3.2 and ruby 1.9.3 running on a dreamhost shared server but I encounter an error which they don't mention. Upon installing rvm it can't install the requirements without root access, which I don't have. It lists the following requirements:

libreadline6-dev, libyaml-dev, automake, libtool, libffi-dev

If I set autolibs to disregard this by setting the following

rvm autolibs 1

and run:

rvm install ruby-1.9.3

then it reaches the compiling step and gives this error:

Error running 'make -j8',
please read /home/USER/.rvm/log/ruby-1.9.3-p392/make.log
There has been an error while running make. Halting the installation.

Does anyone know a way I can circumvent this? I've been trying for a few days now.

This is the contents of make.log:

    CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=implicit-function-declaration  -fPIC 
XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
CPPFLAGS =   -I. -I.ext/include/x86_64-linux -I./include -I.
DLDFLAGS = -Wl,-soname,libruby.so.1.9  
SOLIBS = -lpthread -lrt -ldl -lcrypt -lm  
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling array.c
compiling miniprelude.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling enum.c
compiling enumerator.c
make: *** [enumerator.o] Killed
make: *** Waiting for unfinished jobs....
Stuart
  • 237
  • 2
  • 8
  • include the mentioned log and try with `rvm autolibs 4` – mpapis Apr 03 '13 at 21:42
  • thanks mpapis, that didn't work though. It still requires the sudo password. – Stuart Apr 03 '13 at 21:48
  • `sudo` is required to update your system and install required dependencies, you do not want to use less secure versions of libraries? – mpapis Apr 03 '13 at 21:56
  • well because it's a shared server I don't have the possibility (I don't think) to use sudo. That's why I was wondering if there was an alternative. – Stuart Apr 03 '13 at 22:03
  • there will be a new autolibs option rvm-pkg => https://github.com/wayneeseguin/rvm/issues/1740 - but it does not guaranty the best results, packages should be updated on system level – mpapis Apr 03 '13 at 22:15
  • Sorry @mpapis, I don't really understand what to do with what you're pointing me to there. I ran `rvm autolibs rvm-pkg` but I got an unknown subcommand. Do I need to await the next release or something? – Stuart Apr 03 '13 at 22:51
  • I actually reinstalled rvm with version 1.13.0 and the ruby installation complete successfully. Am I going to run into obvious errors in the future by doing it this way? – Stuart Apr 03 '13 at 23:36
  • most likely security issues, as for `rvm-pkg` - it's not yet implemented – mpapis Apr 04 '13 at 03:04
  • I managed to get rails 4.0.0 and ruby 2.0.0 running on a Dreamhost shared server. I just built from source after encountering same sudo issues you had. Was quite straightforward. – Adam Sep 25 '13 at 07:43
  • Dreamhost? You poor thing. – sevenseacat Oct 08 '13 at 03:41

2 Answers2

3

You should install ruby with the binaries (no compile errors). Like this:

$ rvm list remote

# Rubies available for 'debian/6/x86_64':
  ruby-1.9.3-p194
  ruby-1.9.3-p286
  ruby-1.9.3-p327
  ruby-1.9.3-p362
  ruby-1.9.3-p374
* ruby-1.9.3-p392
  ruby-1.9.3-p429
  ruby-1.9.3-p448
  ruby-2.0.0-p0
  ruby-2.0.0-p195
* ruby-2.0.0-p247

# * - installed already

so then you install the binary like this:

$ rvm mount -r https://rvm.io/binaries/{YOUR_SERVER_ENV}/{RUBY_VERSION}.tar.bz2 --verify-downloads 1

or

$ rvm mount -r https://rvm.io/binaries/debian/6.0.4/x86_64/ruby-1.9.3-p448.tar.bz2 --verify-downloads 1

Of course, you can't use Passenger with RVM and anything other than ruby-1.8.7. See this article to set up FastCGI: http://wiki.dreamhost.com/Rails_3#Using_FastCGI

Nick
  • 443
  • 1
  • 5
  • 15
0

Not sure if this wiki article was around but Dreamhost has one now. Taken straight from it & assuming you have SSH access,

Check to ensure rvm is properly installed:

rvm --version
rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

Get a list of available versions:

rvm list known

Install the version you want

rvm install 2.2.2

Tell the system the default ruby version

rvm use 2.2.2 --default

Check to ensure the proper ruby version is installed

ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]

If that does not work- I would install rvm again following the steps from the tutorial

  1. Install RVM's public keys

    gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
    
  2. Install the latest stable version of RVM and this will

    curl -sSL https://get.rvm.io | bash -s stable
    

    create a new folder under your user named /.rvm
    Add this line to your .bash_profile

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
    

    Add this line to your .bashrc file:

    export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
    
  3. Run this to unset your GEM_HOME

    unset GEM_HOME
    
  4. Run this to source your new RVM install:

    source ~/.rvm/scripts/rvm
    
  5. Add this to your .bashrc file

    source .bash_profile
    
  6. Run this command to update your .bash_profile:

    . ~/.bash_profile
    
  7. Now check if RVM is installed and functioning:

    rvm --version
    rvm 1.26.11 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
    
Daniel
  • 2,950
  • 2
  • 25
  • 45