unable to install passenger - ruby-on-rails

i'm trying to set up a ruby on rails environment to run a website app (clocking it)
unfortunely as I'm a kind of newbie lots of stuff going wrong :p
this is what i got when i run /var/lib/gems/1.8/gems/passenger-3.0.2/bin# ./passenger-install-apache2-module
> * GNU C++ compiler... found at
> /usr/bin/g++ * Curl development
> headers with SSL support... found *
> OpenSSL development headers... found
> * Zlib development headers... found * Ruby development headers... found *
> OpenSSL support for Ruby... found *
> RubyGems... found * Rake... found at
> /usr/bin/rake * rack... not found *
> Apache 2... found at /usr/sbin/apache2
> * Apache 2 development headers... found at /usr/bin/apxs2 * Apache
> Portable Runtime (APR) development
> headers... found at
> /usr/bin/apr-1-config * Apache
> Portable Runtime Utility (APU)
> development headers... found at
> /usr/bin/apu-1-config
Ok so i just miss rack, so i do this:
gem install rack --source http://chneukirchen.org/releases/gems/
Successfully installed rack-1.2.1
1 gem installed
Installing ri documentation for rack-1.2.1...
Installing RDoc documentation for rack-1.2.1...
everyhting looks ok but i still have the same problem
rack is still not found by passenger, how can i solve this ?
other thing I don't understand how to update gem ??
# gem update --system
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
any help is welcome !
I would to follow your how-to but first i need to remove packages installed with aptitude, do you know in this list which ones I need to remove ? this is all the stuff I apt-get since i try to install ruby ...
> aptitude install git-core
> aptitude install libssl-dev zlib1g-dev build-essential
> mysql-server mysql-client
> libmysql-ruby libmysqlclient-dev
> imagemagick libmagick9-dev
> librmagick-ruby librmagick-ruby1.8
> libxslt1-dev
> aptitude install rubygems
> aptitude install ruby1.8-dev
> aptitude install rubygems1.9
> aptitude install rake
> aptitude install rubygems
> aptitude install ruby libzlib-ruby rdoc irb
> aptitude install rubygems1.9
> aptitude install libyaml-ruby
> aptitude install libzlib-ruby
> aptitude install libcurl4-openssl-dev
> aptitude install libopenssl-ruby
> aptitude install apache2-prefork-dev
> aptitude install libapr1-dev
> aptitude install ibaprutil1-dev

Your first mistake was installing RubyGems from apt. I cover the proper way to set this all up in my Ubuntu, Ruby, RVM, Rails and You post. Give that a go and see if that helps you get passenger running.

Related

ruby 2.0 rails gem install error "cannot load such file -- openssl"

I am using osx 10.8.2 installed ruby 2.0 and....
got this when trying to run "sudo gem install rails"
$ sudo gem install rails
ERROR: Loading command: install (LoadError)
cannot load such file -- openssl
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
I had ruby 1.9.x and rails 3.2.x working alright before
You have to install OpenSSL first and recompile ruby again:
RVM:
rvm pkg install openssl
rvm reinstall ruby-2.0.0-p0 --with-gcc=gcc-4.7 --with-openssl-dir=$rvm_path/usr
If you're using RVM please follow:
$ brew install automake
$ rvm pkg install openssl
$ rvm requirements run
$ rvm reinstall all --force
$ gem install rails
It worked for me.
I had very bad time with this ERROR.
Finally i done with it. There is only Once solution either you are with RVM or without RVM.
Make sure you have installed OpenSSL first BEFORE installing ruby.
RVM
Uninstall rvm
rvm implode
or
rm -rf ~/.rvm
Don’t forget to remove the script calls in your .bashrc and/or .bash_profile (or whatever shell you’re using).
sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18 libmysqlclient-dev libyaml-dev curl git-core python-software-properties libpq-dev nodejs
Then install RVM, post ruby.
OR
rvm pkg install openssl
rvm reinstall ruby-2.0.0-p0 --with-gcc=gcc-4.7 --with-openssl-dir=$rvm_path/usr
WITHOUT RVM
First you should find where Ruby is:
whereis ruby
will list all the places where it exists on your system, then you can remove all them explicitly. Or you can use something like this:
rm -rf /usr/local/lib/ruby
rm -rf /usr/lib/ruby
rm -f /usr/local/bin/ruby
rm -f /usr/bin/ruby
rm -f /usr/local/bin/irb
rm -f /usr/bin/irb
rm -f /usr/local/bin/gem
rm -f /usr/bin/gem
THEN
sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18 libmysqlclient-dev libyaml-dev curl git-core python-software-properties libpq-dev nodejs
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
tar -xvzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247/
./configure --prefix=/usr/local
make
make install
I hope this help you.
I fix this error for ruby 2.1.2 as follow.
rvm pkg install openssl
rvm reinstall ruby-2.1.2 --with-openssl-dir=$rvm_path/usr
On OSX, with rbenv and homebrew, the following worked for me:
brew install openssl
CONFIGURE_OPTS=--with-openssl-dir=$(brew --prefix openssl) rbenv install whatever-ruby-version
This worked for me which is similar to some of the other answers already posted.
rvm pkg install openssl
rvm reinstall all --force
When installing ruby 2.0, it is possible that rubygems 2.0 installation did not complete ok, because of openssl.
Make sure you provide a valid path to the openssl config file; you could:
find . -type f -name "openssl.cnf"
path is usually $HOME/.rvm/usr or $HOME/.rvm/usr/ssl
Then
[sudo] rvm reinstall ruby-2.0.0-p0 --with-openssl-dir=[openssl.cnf path] --verify-downloads 1
Make sure rubygems installation complete successfully.
Might be a better way to fix that path without reinstalling, but this should do it.
Make sure to check out this page on the rvm site: https://rvm.io/packages/openssl/
Running
rvm requirements run
gave me:
Missing required packages: autoconf, automake, libtool, pkg-config, apple-gcc42, readline, libxml2, libxslt, libksba, openssl, sqlite
after brew install autoconf automake ...
I was able to rvm reinstall 2.0.0 without openssl errors
I had the same problem with the same OS version. I use rvm and followed the steps in this command:
$ rvm requirements
Following those instructions, I ran:
$ brew update
$ brew tap homebrew/dupes
$ brew install bash curl git
$ brew install autoconf automake apple-gcc42 libtool pkg-config openssl readline libyaml sqlite libxml2 libxslt libksba
I had the same problem earlier, tried all of the snippets about and none of them worked out. After looking around for a bit the following worked for me:
$ rvm remove 2.0.0 # get rid of unsuccessful installation
$ rvm get head --autolibs=3 # get the latest RVM and build required libs
$ rvm requirements # just in case, install all other required stuff
$ rvm install ruby-2.0.0
$ rvm --default use ruby-2.0.0
What does rvm get head --autolibs=3 do exactly? I'm guess it automatically downloads dependencies, but I was hoping for a clear answer.
I encountered the same openssl error on Fedora when trying to use gem install <package>. It seems you need to install additional packages with yum/dnf
sudo dnf install rubygems rubygem-bundler ruby-devel mariadb-devel
After running the above command, gem install <package> should now work.
just went through the same problem. Takes a bit time but, upgrading openssl with
brew upgrade openssl#1.1
worked for me. Version might be different in the future, type brew install openssl to see which version you can upgrade to. I hope it helps.
If you have libssl1.1, your problem may be that these older versions of ruby (2.4 is the cutoff) are only compatible with libssl1.0.
For debian/ubuntu, please ensure that apt-get install libssl1.0-dev succeeds.
If you are using ruby-install, it will take the same openssl argument as rvm:
ruby-install ruby-2.0.0-p247 -- --with-openssl-dir=/usr/local/opt/openssl

Trouble installing ruby on rails

I'm getting
ERROR: While executing gem ... (NameError) uninitialized constant Gem::RemoteFetcher::OpenSSL
When I try to run # gem install rails
I already have
Ruby v1.8.7
Gem (rubygems.nonarch) v1.7.2
Installed.
Any Idea what I should do?
Running sudo gem install rails now gives me:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/ruby.h
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/json-1.7.4 for inspection.
Results logged to /usr/lib/ruby/gems/1.8/gems/json-1.7.4/ext/json/ext/generator/gem_make.out
Everything Installed via YUM
Running Fedora 15
I was having a similar issue while doing #gem install rake, but I found out that my system was behind a proxy server, and so I tried supplying the proxy address by this command:
gem install rake -p http//IPaddress:proxyport (put : after http)
and it worked for me, with no such error afterwards.
Hit rvm requirements. You don't have libssl-dev installed.
➜ ~ rvm requirements
Requirements for Linux ( DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.10
DISTRIB_CODENAME=maverick
DISTRIB_DESCRIPTION="Ubuntu 10.10" )
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the *original* / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius
bash >= 4.1 required
curl is required
git is required (>= 1.7 for ruby-head)
patch is required (for 1.8 rubies and some ruby-head's).
To install rbx and/or Ruby 1.9 head (MRI) (eg. 1.9.2-head),
then you must install and use rvm 1.8.7 first.
Additional Dependencies:
# For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following:
ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
# For JRuby, install the following:
jruby: /usr/bin/apt-get install curl g++ openjdk-6-jre-headless
jruby-head: /usr/bin/apt-get install ant openjdk-6-jdk
# For IronRuby, install the following:
ironruby: /usr/bin/apt-get install curl mono-2.0-devel
I'm not aware how Fedora's requirements differ from Ubuntu's, but that's probably only in package names.
I have just had same issue with gem install on Ubuntu. It is now working and I think that what I did to fix it was enable ssl out through the firewall.
It looks as if gem returns this error in response to failure to establish an SSL connection, presumably while trying to handle the failure.
Russell

Installing Apache Passenger , Ruby Development Headers Not Found

I have a RoR app that needs to be hosted on Apache, so I have been trying to install Apache Passenger. When I run the following command:
sudo passenger-install-apache2-module
I get:
Checking for required software...
* GNU C++ compiler... found at /usr/bin/g++
* Curl development headers with SSL support... found
* OpenSSL development headers... found
* Zlib development headers... found
* Ruby development headers... not found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /usr/local/bin/rake
* rack... found
* Apache 2... found at /usr/sbin/apache2
* Apache 2 development headers... found at /usr/bin/apxs2
* Apache Portable Runtime (APR) development headers... found at /usr/bin/apr-1-config
* Apache Portable Runtime Utility (APU) development headers... found at /usr/bin/apu-1-config
So it asked me to run the following command:
sudo apt-get install ruby1.8-dev
and I have done this with the following result
Reading package lists... Done
Building dependency tree
Reading state information... Done
ruby1.8-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 40 not upgraded.
So when I run:
sudo passenger-install-apache2-module
I get the same result asking me to run:
sudo apt-get install ruby1.8-dev
If, like me, you are running the apt package ruby1.9.1 instead of 1.8 then install ruby1.9.1-dev instead
sudo apt-get install ruby1.9.1-dev
This worked for me. Hope it helps.
After installing the missing headers, go back to the beginning and recompile passenger:
gem install passenger
Try uninstalling ruby1.9 and installing ruby1.8 instead then reinstall the passenger gem. This worked for me.
First install packages:
for Ubuntu:
sudo apt-get install libcurl4-gnutls-dev
sudo apt-get install apache2-dev
for CentOS (good tutorial):
yum install curl-devel apache2-devel
After install gem:
gem install passenger
And successfully configurate it:
sudo passenger-install-apache2-module
I have found that with some Passenger requirements you need to log out of and then log back into the current user after you've installed them before passenger-install-apache2-module recognises the changed configuration.

How do I install Ruby with libyaml on Ubuntu 11.10?

I installed ruby-1.9.3-p0 on my Ubuntu 11.10 wubi and then rubygems to get Rails set up.
This is my code:
sudo ruby setup.rb
I got this error:
"/usr/local/lib/ruby/1.9.1/yaml.rb:56:in'<top(required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby."
I installed libyaml and reinstalled Ruby but still it doesn't work.
The information changed and I have no idea what's wrong with it.
You must install the paquage libyaml-dev before installing ruby, if not you can still use extconf.rb for the missing library. So for this problem you can do (from the ruby install folder) :
cd ext/psych
ruby extconf.rb
make
make install
Extconf.rb is usefull for adding a library after have installed ruby.
Do the following:
you must have "curl" installed :sudo apt-get install curl
Go To this link RVM
Copy the command in the quick install box and Paste it in your command prompt
Type echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
Type ~/.bashrc
Type the following code:
sudo apt-get install build-essential libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
Type: rvm install 1.9.3-p0
Type: rvm use 1.9.3-p0
Type: gem install rails
Have fun :)
Ok, after a failed attempt at installing RoR on my Ubuntu 11.10 box, I combined the tips from this page and from this resource: http://www.thegeekwork.com/how-to-install-ruby-on-rails-in-ubuntu-11-10/
This is the breakdown, step-by-step of what I just did to make this work (sorry if I didn't format this so great, I was just trying to keep it neat):
1) Fresh install of Ubuntu 11.10
2) me#Box:~$ sudo apt-get install curl
3) me#Box:~$ sudo apt-get install git
4) me#Box:~$ sudo apt-get update
5) me#Box:~$ sudo apt-get dist-update
6) me#Box:~$ sudo shutdown -r now
7) me#Box:~$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
8) me#Box:~$ gedit ~/.bashrc
9) add the following line to the end (and save the file)
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
10) me#Box:~$ source ~/.bashrc
11) me#Box:~$ type rvm | head -1
After executing above command you should be getting this output -
rvm is a function
You’ve successfully installed the RVM. Next, you are supposed to install additional dependencies. To find out those programs type -
12) me#Box:~$ rvm requirements
After the above command, install the additional packages recommended by RVM -
13) me#Box:~$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
14) me#Box:~$ rvm install 1.9.2
(#14 takes a little while)
15) me#Box:~$ rvm use 1.9.2
(This selects the version you want to use)
(If you aren’t sure about the ruby version currently being used, then type -
ruby -v)
16) me#Box:~$ gem install rails
(this will take a little while...)
17) Make a sample application as a test...
me#Box:~$ rails new test_app
me#Box:~$ cd test_app
me#Box:~/test_app$ rails server
AND THAT"S WHERE THIS THING DIDN"T WORK. ARRRRRRRRRrrrrrrrrrrrrrgh.
So,
18) in your application folder ("test_app"), open Gemfile and uncomment "therubyracer" line
19) me#Box:~/test_app$ bundle install
20) me#Box:~/test_app$ rails server
Done, and done.
I don't understand why it set 0.0.0.0:3000 as the host address (I thought it would be 127.0.0.1), but quite frankly, that's not bothering me right now -- I got it to work (so far). Time to get going with some Rails! :D
I hope this helps anyone else who is looking to make this work! :)
Note: I realize that #13 repeats some of the things I already installed, but I don't care, I'm just doing what the thing says. :/
Note2: Holy learning curve on just posting an answer! I wasn't sure what was considered "code" and apparently the prompt is considered code. Makes sense now :)
Note3: This is my first "Answer" on StackOverflow! :D
If you are compiling ruby you might need libyaml-dev
Debian (and Ubuntu, etc.) packages that contain the files needed to install some other program from source usually end in -dev, e.g. libyaml-dev, so try installing that. Or just use rvm, it will actually install this for you.
Compling yaml from its source will make it work. I am running the same config as yours. I followed this http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/. It definitely works.

Rails install fails on Ubuntu 10.10

I'm trying to install rails on Ubuntu 10.10, but get File not found: lib every time. Ruby and Rubygems have been installed correctly. I've seen this problem posted all over the web but no solutions work for me. I reinstalled rdoc and I still get the same result.
$ sudo gem install rails
...
Successfully installed rails-3.0.1
24 gems installed
...
Installing ri documentation for builder-2.1.2...
ERROR: While generating documentation for builder-2.1.2
... MESSAGE: Unhandled special: Special: type=17, text="<!-- HI -->"
... RDOC args: --ri --op /var/lib/gems/1.8/doc/builder-2.1.2/ri --title Builder -- Easy XML Building --main README --line-numbers --quiet lib CHANGES Rakefile README doc/releases/builder-1.2.4.rdoc doc/releases/builder-2.0.0.rdoc doc/releases/builder-2.1.1.rdoc --title builder-2.1.2 Documentation
(continuing with the rest of the installation)
...
Installing ri documentation for rails-3.0.1...
File not found: lib
$ rails -v
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
I wrote a detailed how-to guide on installing Ruby and Rails on Ubuntu 10.10 that will help you with this.
Guaranteed, or your money back!
You should avoid the packaged version of Ruby (i.e., avoid the version of Ruby that comes from apt-get install ruby). The Debian packaging system (which Ubuntu uses) conflicts with what Ruby expects.
Instead, you should install Ruby from source.
There's a nice tool called RVM to help you do this.
# Install prerequisites
$ sudo apt-get install git curl wget
# Download and install RVM
$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )
# Install RVM into your .bash_profile
$ cat >> ~/.bash_profile <<-PROFILE
> [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
> PROFILE
# Load RVM into the current shell
$ rvm reload
# Install prerequisites
$ rvm notes
$ sudo apt-get install \
> build-essential bison openssl libreadline6 libreadline6-dev curl \
> git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 \
> libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev \
> ncurses-dev
# Install Ruby
$ rvm install ruby-1.9.2-p180 # latest version as of now
$ rvm use ruby-1.9.2-p180 --default
# Check it
$ ruby -v
$ which ruby
$ gem install rails

Resources