Created
January 23, 2017 10:29
-
-
Save masudcsesust04/e7f83121ef7882ed233201571dd661bf to your computer and use it in GitHub Desktop.
Rails developer environment preparation in linux(ubuntu) operating system.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ubuntu OS environment setup for rails development: | |
1. Install Ubuntu OS then update and upgrade system packages | |
2. Install Sun JDK-1.6 or Oracle JDK-1.7 or latest availabe version (Not open JDK) | |
3. Install an IDE (RubyMine for Ruby on Rails team members, Netbeans for Ruby on Rails, Java, PHP etc, PHPStrom for PHP team members) | |
4. MySQL or PostgreSQL | |
5. If MySQL then i would recommed to install it with LAMP package which is a linux, apache, MySQL and PHP bundle. Because installing LAMP you can use phpMyadmin as database client. | |
6. If you install only MySQL then choose workbench as a database client. | |
7. For PostgreSQL install pgAdmin-III as a database client | |
8. Install Sublimetext as a text editor | |
9. Install Nano or Vim as a text editor | |
10. Install Gimp for image editor | |
11. Install Google chrome browser for development with firefox(which is default comes up with ubuntu) | |
12. Install Skype if required for client communication | |
13. Install GIT or SVN as source code manager | |
14. Install RVM for ruby version manager | |
15. Install Ruby latest version should be install with RVM | |
16. Install Rails latest version | |
17. Install imageMagick | |
18. Install wget or curl for faster and reliable file or package download | |
19. Install gitk for git commit change | |
20. Install nodejs | |
21. Install atom editor | |
22. Install gitkraken git client | |
2. For install oracle jdk | |
sudo apt-get purge openjdk* | |
sudo add-apt-repository ppa:eugenesan/java | |
sudo apt-get update && sudo apt-get install oracle-java7-installer | |
OR | |
# Step 1: Add the repository for JDK 7. | |
sudo apt-add-repository ppa:webupd8team/java | |
# Step 2: Update | |
sudo apt-get update | |
# Step 3: Install JDK and associated utilities | |
sudo apt-get install oracle-java7-installer | |
# Step 4: Set the default java interpreter used by the system. | |
sudo update-alternatives --config java | |
3. RubyMine | |
Download rubymine first from the following link- | |
Step-1: | |
Create the following directory excluding a version to make it easier to upgrade etc. /opt/Rubymine. | |
sudo mkdir -p /opt/RubyMine | |
Step-2: | |
Extract Archive | |
sudo tar -zxvf RubyMine-6.0.tar.gz --strip-components 1 -C /opt/RubyMine | |
Change file structure ownership to root recursively. | |
sudo chown -R root:root /opt/RubyMine | |
Run RubyMine- Sudo the first time run so the appropriate permissions are available to create the desktop configuration file etc. | |
1. sudo /opt/RubyMine/bin/rubymine.sh | |
2. If applicable Import Settings | Enter License Key | |
3. Accept Terms | |
Launcher File -If Rubymine was launched prior to renaming the directory, then you may need to tweak the Unity desktop config file. | |
sudo vim /usr/share/applications/jetbrains-rubymine.desktop | |
Example: | |
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Name=JetBrains RubyMine | |
Exec="/opt/RubyMine/bin/rubymine.sh" %f | |
Icon=/opt/RubyMine/bin/RMlogo.svg | |
Comment=Develop with pleasure! | |
Categories=Development;IDE; | |
Terminal=false | |
StartupNotify=true | |
StartupWMClass=jetbrains-rubymine | |
Ref: http://www.bonusbits.com/main/HowTo:Install_RubyMine_on_Ubuntu | |
4. LAMP(Linux + Apache + MySQL + PHP) | |
sudo apt-get install lamp-server^ | |
Note: Middle of the installation it will ask you to enter mysql root user password enter your prefferred password on there. | |
It will be the root user password and you have to use that passord when connect mysql via any MySQL client or console. | |
You can install phpmyadmin as a client by runing the command below. | |
sudo apt-get install phpmyadmin | |
Ref.: http://tuxtweaks.com/2011/10/install-lamp-and-phpmyadmin-on-ubuntu-11-10/ | |
8. Install sublime text | |
Download sublime text .deb file from here http://www.sublimetext.com/ | |
Then navigate the path where it's downloaded also make sure the dowloaded package is in a write permission directory. | |
Simple move it into /home path or any other directory under /home direcotry then run the command below | |
sudo dpkg -i package-name | |
sudo apt-get -f install | |
9. Nano and VIM | |
sudo apt-get install nano | |
sudo apt-get install vim | |
10. Install Gimp for image editor | |
It's commes up by default with ubuntu | |
11. Google chrome installation | |
Download the latest dpkg package and navigate the download folder via terminal and then run the command below. | |
sudo dpkg -i google-chrome-stable_current_i386.deb | |
sudo apt-get -f install | |
12. Install Skype if required for client communication | |
Go to software center and search by 'skype' then install | |
13. Install GIT or SVN as source code manager | |
14. RVM installation | |
You have broken version of RVM. Ubuntu does something to RVM that produces lots of errors, the only safe way of fixing for now is to: | |
sudo apt-get --purge remove ruby-rvm | |
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh | |
open new terminal and validate environment is clean from old RVM settings (should be no output): | |
env | grep rvm | |
if there was output, try to open new terminal, if it does not help then restart your computer. | |
Install RVM(this will install RVM and Latest ruby version): | |
\curl -L https://get.rvm.io | bash -s stable --ruby --autolibs=enable --auto-dotfiles | |
If you find you need some hand-holding, take a look at Installing Ruby on Ubuntu 12.04, which gives a bit more explanatio | |
Ref: | |
(a) http://rvm.io/rvm/install | |
(b) http://stackoverflow.com/questions/9056008/installed-ruby-1-9-3-with-rvm-but-command-line-doesnt-show-ruby-v/9056395#9056395 | |
(c) http://stackoverflow.com/questions/21772116/error-while-install-mysql-gem | |
(d) http://stackoverflow.com/questions/11138376/how-to-make-rvmrc-file-in-project-root-folder | |
15. Ruby installation | |
After installing RVM follow the bellow | |
rvm list known | |
rvm install 2.1 [install a specific ruby version] | |
rvm use 2.1 --default | |
Ref: http://rvm.io/rvm/install | |
16. Rails installation | |
You can install it by an ide when creating a project | |
17. ImageMagick | |
Let do some troubleshoot first: | |
convert --version | |
which convert | |
identify --version | |
identify -list format | |
brew install ImageMagick [For Mac] | |
sudo apt-get install ImageMagick [For debian distribution] | |
After installation: | |
convert --version | |
which convert | |
identify --version | |
identify -list format [will show list of available decode delegate] | |
identify -list format | grep | |
Ref: http://www.imagemagick.org/script/binary-releases.php | |
18. wget or curl | |
sudo apt-get install wget | |
sudo apt-get install curl | |
19. GITK | |
sudo apt-get install gitk | |
https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-front-end-proxy-for-apache | |
20. Apache virtual host configuration | |
https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-14-04-lts | |
21. phpmyadmin intallation | |
sudo apt-get install phpmyadmin | |
# Edit: Do this first(add this line somewhere) | |
sudo gedit /etc/apache2/apache2.conf | |
Include /etc/phpmyadmin/apache.conf | |
# Finally restart apache. | |
/etc/init.d/apache2 restart | |
22. Capistrano deployment | |
cap deploy:setup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment