Answer the question
In order to leave comments, you need to log in
Gems are installed in /root, the paths are not the same. Where did you mess up and how to fix it?
Comrades, I need help, my brain exploded. On an already running VPS under Ubuntu 12.04 with Apache, PHP and MySQL, I decided to install Redmine on a separate subdomain. For him, of course, you need to install Ruby and Rails, and then Passenger. I'm not friends with Ruby yet, I followed several instructions, comparing and checking:
https://grandslam90.wordpress.com/2012/05/22/howto...
www.redmine.org/projects/redmine/wiki/RusRedmineInstall
Everything seemed to go well, it completely coincided with the instructions, and Redmine even launched under WEBrick. I started installing Passenger, and then there were inconsistencies. For starters, "passenger-install-apache2-module" didn't run - command not found. With the help of Google, I realized that either you need to register the path in PATH, or run it with the full path. It was useful to look for where it lies, and was surprised that all the gems I have are in "/root/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/", although logically they should be in "/var/lib/gems/2.0.0/gems". I started Passenger manually, then the installer cursed and asked me to do "chmod o + x / root", which already completely strained me.
Log from the beginning:
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
apt-get install gcc
apt-get install libssl-dev
rbenv install 2.0.0-p451
rbenv global 2.0.0-p451
rbenv rehash
ruby -v
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler
apt-get install python-software-proprties
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs
gem install rails --version 4.0.0 --no-ri --no-rdoc
rbenv rehash
rails -v
cd /usr/share
wget http://www.redmine.org/releases/redmine-2.5.0.tar.gz
tar xvfz redmine-2.5.0.tar.gz
rm redmine-2.5.0.tar.gz
mv redmine-2.5.0 redmine
chown -R root:root /usr/share/redmine
chown www-data /usr/share/redmine/config/environment.rb
ln -s /usr/share/redmine/public /var/www/office.paspar2.com/httpdocs
mysql -u root -p
CREATE DATABASE redmine character SET utf8;
CREATE user 'redmine'@'localhost' IDENTIFIED BY '**********';
GRANT ALL privileges ON redmine.* TO 'redmine'@'localhost';
exit
cp redmine/config/database.yml.example redmine/config/database.yml
nano redmine/config/database.yml
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: **********
encoding: utf8
apt-get install libmysqlclient-dev
apt-get install libmagickcore-dev libmagickwand-dev
gem install bundler
cd redmine
bundle install --without development test postgresql sqlite
cd /usr/share/redmine
rake generate_secret_token
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data
mkdir tmp tmp/pdf public/plugin_assets
chown -R www-data:www-data files log tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
ruby script/rails server webrick -e production
gem install passenger
apt-get install libcurl4-openssl-dev libssl-dev apache2-prefork-dev libapr1-dev libaprutil1-dev
passenger-install-apache2-module
~/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/bin/passenger-install-apache2-module
LoadModule passenger_module /root/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/passenger-4.0.38/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /root/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/passenger-4.0.38
PassengerDefaultRuby /root/.rbenv/versions/2.0.0-p451/bin/ruby
</IfModule>
Answer the question
In order to leave comments, you need to log in
You have everything installed in /root, since you are doing the installation as root. It's better to install everything via sudo from a regular user account.
Then everything is put in the "hamster" of this user.
As for passenger, when installing it, it is possible to set the location directory (if you do not want to change the rights to the directory with the module).
Check out the official Passenger installation documentation - www.modrails.com/documentation/Users%20guide%20Apa... I
recommend installing ruby via RVM - https://rvm.io/rvm/install
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question