Configuring the Ruby on Rails framework and RubyMine IDE development environment _ruby topics on Ubuntu

Source: Internet
Author: User
Tags curl ruby on rails

The crushing reading of the preparation stage

During the VirtualBox installation process, many pits were produced due to such reasons.

Pit 1, about terminals, be sure to use the initiator to open

Install the virtual machine, enter the system, we will encounter the first pit, terminal software, we recommend that everyone use the initiator to open the terminal,

Do not use the File Manager, access the folder, and then the right button "open in the terminal", this time, the environment variable loading, especially in the non-desktop folder entry. The terminal does not load the environment variable, most of the software can not be executed in the terminal.

When you open the terminal, be sure to go through the launcher, the so-called initiator, is placed in the Bantu on the left side of the desktop, much like Windows shortcuts

Pit 2, on the assumption that most sites assume you have some basic packages or software installed, but there is no mention, which makes the novice to build the environment especially laborious.

Workaround: Manually install the software, command:

 Apt-get Install bag Name

The software installation timed out for a variety of reasons at home.

You are in the bottom of the installation process, if there is a positive rejection of the server, 80% of the possible line is by the wall. Or be your company, home network screen off or appear a slow, half a day does not move phenomenon, congratulations, you have to change the source address.

RVM Workaround: After installing RVM, make sure that RVM-V can perform the following command to replace server resource information

Sed-i-E ' s/ftp\.ruby-lang\.org\/pub\/ruby/ruby\.taobao\.org\/mirrors\/ruby/g ' ~/.rvm/config/db

Gem Solution:

Gem source

gem source-r https://rubygems.org/

gem source-a https://ruby.taobao.org///Add Taobao

If you are prompted to not find the installation package, manually update the randomly-brought packages:

sudo apt-get update

Installation steps

1. Update random packages, this is necessary, or the following may produce more than n error

sudo apt-get update

2. Installation curl, we need to use it to install RVM

sudo apt-get Install Curl

3. Install RVM, we use RVM to install ruby, rails, etc., RVM installation See: Https://ruby-china.org/wiki/rvm-guide

Curl-l Get.rvm.io | Bash-s Stable

//Unable to check signature: Public key not found, execute bottom statement (is a pit)

gpg--keyserver hkp://keys.gnupg.net--recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

//Then, again, after the installation of RVM, you need to configure the terminal, so that the next time you open the terminal can directly use only RVM. To change the terminal configuration method: See https://rvm.io/integration/gnome-terminal

curl-l Get.rvm.io | bash-s stable

//So, RVM installation completed, Below we manually configure the RVM environment for the terminal, otherwise, you may have to manually load the RVM environment

//Change the terminal configuration method in the terminal each time: Toolbars--edit--profile preferences--title and command--command--select "Run commands as login Shell"

// Then, we manually load the RVM environment, the server resources into Taobao

///////$ source ~/.RVM/SCRIPTS/RVM The official Load RVM Environment command, we do not perform

//temporary loading RVM environment, reference: https:/ /rvm.io/integration/gnome-terminal source

~/.bash_profile

//change RVM Sources server resource information, After all, foreign often by the wall off, there is the speed of the domestic fast. If not set, there may be a variety of problems, such as a positive rejection of the server (by the wall), or slow download speed

sed-i-E ' s/ftp\.ruby-lang\.org\/pub\/ruby/ruby\.taobao\.org\/ Mirrors\/ruby/g ' ~/.rvm/config/db

//Please save your work, then restart the Ubuntu system

sudo reboot

//Restart the terminal, we can use the RVM,

//List the available Ruby versions

RVM list known on the RVM remote server

4. Install Ruby, we choose the latest, without the version number that means the latest,

RVM install ruby

RVM use x.x.x--default//Set default version

If prompted

RVM is isn't a function, selecting rubies with ' RVM use ... ' would not work.

Then load the configuration file anew

SOURCE ~/.bash_profile

5. Below we want to use gem, before using, first switch to Taobao server gem more use, see://View the current Gem source list, the default source is

https://rubygems.org/

6. Installing Rails with Gems

Gem Install rails///////////////////////////

and start installing Ruby on Rails.

ruby-v//View the ruby version

rails-v//view the rails version

If the version is not a problem, start creating the project, omitting 100 words here.

After the project is created, you need to install the JS compiler (sometimes you don't need to know why, if you need to, you can put it on the safe side.)

sudo apt-get install python-software-properties

sudo add-apt-repository ppa:chris-lea/node.js

sudo apt-get Update

sudo apt-get install Nodejs

And then start

 Rails S 

If the startup is successful, you can view the Web site in http://localhost:3000


installation of RubyMine under Ubuntu

1. Website download JDK, decompression

You can manually extract or use the command line, feel the meaning of the same. or use the mouse to cool a little feeling.

$tar-XZVF jdk-8u20-linux-x64.tar.gz

2. Copy to Usr/lib

In general, it is customary to put it under this directory, of course, not the decision can be based on their own environment to choose to store the directory

sudo cp-r ~/JDK1.8.0_20/USR/LIB/JVM

3. Configure Environment variables

sudo gedit ~/.profile

Add environment variables at end of file

Export JAVA_HOME=/USR/LIB/JVM/JDK1.8.0_20

Then save and update to see if you added success

SOURCE ~/.profile

Env

Java_home This variable appears and is consistent with the added directory to indicate that the environment variable was successfully modified

3. Modify the default JDK

$sudoupdate-alternatives--install/usr/bin/java java/usr/lib/jvm/jdk1.8.0_20/bin/java300

$ Sudoupdate-alternatives--install/usr/bin/java java/usr/lib/jvm/jdk1.8.0_20/bin/javac300

$ Sudoupdate-alternatives--config java

$sudoupdate-alternatives--config javac
$ java-version//view Java version Is it a newly installed version

4. Download RubyMine on the Internet, then unpack, enter Bin, run./rubymine.sh Open.

Bite.... Perfect.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.