Install Mysql 5.7 on High Sierra - ruby-on-rails

I want to install mysql 5.7 on my Mac OS 10.13.5. However, brew install mysql installs version 8.0 which is not suited for my project. Forgive me if this question was asked before but I could not find a solution.

Now it's bit differently
brew install mysql#5.7

$ brew install mysql55
This installs a specific version 5.5 which exists along with 8.0
Also mysql entry should be added to .bash_profile to make sure it load and then server start should be done.
$ brew services start mysql#5.5
Below command gives the sequence of how the files are loaded in sequence.
$ mysql --verbose --help | grep my.cnf
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
While installing first mysql server instance works perfectly, installing a different version of mysql instance should be configured properly and the paths of installation, log files and other components have different path.
Installation paths be found here, for eg.
mysql -> ../Cellar/mysql/8.0.11/bin/mysql

Related

(React on Rails) The engine "node" is incompatible with this module. Expected version "..."

For those familiar with the react-on-rails gem, or more generally, yarn:
Just today I updated my Node version to 8.8.1 via Homebrew. Now, when I attempt to run bundle && yarn && foreman start -f Procfile.dev (or just yarn install), I get the following message:
error react-webpack-rails-tutorial#0.0.1: The engine "node" is
incompatible with this module. Expected version "5.10.0".
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation
about this command.
This is likely a very simple issue I am running into, but I have been unable to fix it after a few hours of debugging.
I tried manually updating my Node version in package.json to be that on my computer (did not seem to take effect whatsoever), downgrading my version to 5.10.0 via Homebrew (but was unable to), and even upgrading to the latest version of the gem which meant installing webpack as well.
No matter what I did, my local server startup (bundle && yarn && foreman start -f Procfile.dev) still lead to the same error above. Any ideas for this poor soul?
For anyone running into this same issue, I have not found a solution for the underlying issue but I have found a temporary workaround.
Simply run
bundle && yarn --ignore-engines && foreman start -f Procfile.dev
instead of
bundle && yarn && foreman start -f Procfile.dev
I hope this helps someone else that may have found themselves stuck in the same situation!
You need to update your Node.js version. Try to
Clear NPM's cache:
sudo npm cache clean -f
Install a little helper called 'n'
sudo npm install -g n
Install latest stable Node.js version
sudo n stable
I give you this list of checks to do from the react-webpack-rails-tutorial github page
Basic Demo Setup
Be sure that you have Node installed! We suggest nvm, with node version v6.0 or above. See this article Updating and using nvm.
git clone git#github.com:shakacode/react-webpack-rails-tutorial.git
cd react-webpack-rails-tutorial
Check that you have Ruby 2.3.0 or greater
Check that you're using the right version of node. Run nvm list to check. Use 5.5 or greater.
Check that you have Postgres installed. Run which postgres to check.
Use 9.4 or greater.
Check that you have qmake installed. Run which qmake to check. If
missing, follow these instructions: Installing Qt and compiling
capybara-webkit
Check that you have Redis installed. Run which redis-server to
check. If missing, install with Homebrew (brew install redis) or
follow these instructions.
bundle install
brew install yarn
yarn
rake db:setup
foreman start -f Procfile.hot
Open a browser tab to http://localhost:3000 for the Rails app
example with HOT RELOADING
Try Hot Reloading steps below!
foreman start -f Procfile.static
Open a browser tab to http://localhost:3000 for the Rails app
example.
When you make changes, you have to refresh the browser page.

How to install Grails on Linux Ubuntu LTS?

I have Linux Ubuntu 14.04 LTS. I wanted to install Grails and I have found informations on how to install it on Ubuntu 14.04 VPS here. So I am a little confused.
What are the difference between the two versions, LTS and VPS?
Does it matter if I do not have VPS version?
Can I install Grails on my Ubuntu? If yes, how?
A very simple way on Linux/Unix OS is to use the GVM Tool.
After installing the GVM tools you simply run
$ gvm install grails 2.4.3
in order to install Grails 2.4.3
UPDATE: Meanwhile gvm was renamed to sdkman.
Install sdkman
$ curl -s "https://get.sdkman.io" | bash
In order you want to continue working in the same terminal window execute
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
To install the latest version of Grails simply run
$ sdk install grails
or if need a specific version you can run
$ sdk install grails 2.4.3
You may try these steps. But this is just a guess, am not much sure about LTS and VPS
download grails-{desired version} zip file
extract it into any folder.
edit .bashrc in home folder such that
JAVA_HOME=/path/to/java/jdk1.6.0_25-64/
export JAVA_HOME PATH=$JAVA_HOME/bin:$PATH export PATH
export GRAILS_HOME=/path/to/grails/grails-2.4.2/
export PATH="$PATH:$GRAILS_HOME/bin"
try to run grails command in terminal
VPS stands for Virtual Private Server in general (no special Ubuntu version) and LTS for Long Time Support added to a version number of Ubuntu to annotate a longer livetime (e.g. making this versions more suitable for servers). So these letters have not much influence on your way of installing Grails. The instructions there (installing JDK from OS and using sdkman (formerly GVM)) are sound advice to run Grails.

Install RVM itself without internet connection

I am switching from DJANGO to Rails, but i don't know how to install RVM in PROD environment.
My PROD server is without internet connection, and not possible connect even for a while. And i cannot find a standalone install package of RVM.
Is there any solution for offline RVM installation?
BTW, can rails be installed without internet?
I just spent some time and build a tutorial for the offline mode: https://rvm.io/rvm/offline - it's the first version so feel free to improve it here: https://github.com/wayneeseguin/rvm-site/blob/master/content/rvm/offline.md (Edit button).
Additionally to my first answer another way to do it would be to compile ruby on online machine, then package it, unpack on the other end and add it to PATH on the offline machine.
Way 1 - only Ruby
curl -L https://get.rvm.io | bash -s stable
source $HOME/.rvm/scripts/rvm
rvm install 1.9.3 --movable
rvm prepare 1.9.3
Some information will be displayed, including file name. Copy it to the offline machine and unpack it there, then just add it to PATH:
echo 'PATH=$PATH:${unpacked_dir}/bin' >> ~/.bashrc
Way 2 - whole RVM:
curl -L https://get.rvm.io | sudo bash -s stable
source /usr/local/rvm/scripts/rvm
rvm use 1.9.3 --install
gem install rails -v 3.2.8
rails new rails3
rvm use 1.8.7 --install
gem install rails -v 2.3.14
rails new rails2
tar czf rvm_and_ruby.tgz /usr/local/rvm /etc/rvmrc /profile.d/rvm.sh
Unpack on the offline end:
cd /
sudo tar xzf rvm_and_ruby.tgz
And open a new terminal.
check http://railsinstaller.org/ (for windows and mac) .After then change environment into production mode . In linux this works export RAILS_ENV=production .
If you are using a linux OS, you can always package the app as a debian or rpm archive which will include rails and the dependent gems referred in your Gemfile. The advantage with this approach is that you can also configure the archive to setup external dependencies like any other deb or rpm package. One of my recent projects came up with a in house solution. Now there are tools like pkgr
You can download a standalone RVM package here: https://github.com/wayneeseguin/rvm/tags
You can reference the RVM installer script for details on what an RVM install does. Simply replace the network calls with references to some local file, and you should be good to go.
That said, once RVM is installed, I'm not sure if it'll let you do an offline Ruby install easily, but this should get you started.
Well you need to download the source code from somewhere to install RVM, Rails. Not very clear as to how your Prod environment lacks an internet connection. Could you please give more details?

Problems finding ruby, rails, git after bungled PostgreSQL install

I had rails working fine for several weeks but I tried to install PostgreSQL to match Heroku and it failed to work. Now, when I open the terminal it pretend rails is not there and sets the default ruby to 1.8.7. When I start RVM it finds the right version of ruby and finds rails again and can start the server but each time I open a new shell it's back to not finding anything. Plus, the git commands don't work even after starting rvm.
I have set rvm to start by default but that doesn't work either, it has to be started manually, and it still doesn't fix the git issue.
More Detail
I am installing on Mountain Lion. This already has Postgres but the tutorial I was using suggested installing fresh using Homebrew. The trouble was the Homebrew installation installs to /usr/local/var/postgres and the installed ppstgres installs to usr/var/postgres. The system automatically uses the usr/var/postgres version, so following the tutorial I chnaged the order of usr/local/bin and usr/bin in etc/paths. That didn't help so I changed it back. Everything then went to hell so I reinstalled Mountain Lion but nothing had changed.
There are two known problems with loading RVM & default ruby:
login shell: go to terminal emulator preferences and enable login shell, sometimes it might be required to use /bin/bash --login instead.
ZSH (+ Oh-My-ZSH): go to ~/.zshrc and comment out any lines starting with: PATH= or path=(, it is still possible to use those but they need to reference itself like: PATH=$PATH:HOME/.rvm/bin or path+=( $HOME/.rvm/bin ) - which update and not reset PATH. This might be a bug in terminal emulator or ZSH ...
The git issue is explained by the reinstall of Mountain Lion which did not automatically install the command line tools. That now works. The only pain is having to load rvm every time now.

Trouble installing mysql2 gem, libmysqlclient.so.15 Load Error

veHi,
I'm trying to install Rails 3.0 with Ruby 1.9.2. on a Linux box. I'm behind a firewall and do not have root access on my machine so I'm trying to build everything in my home directory. I don't have access to apt-get or yum - I have to build everything from source (except for gems).
I've successfully compiled and built Ruby, Rails, and MySQL. My problem is that rails can't find the libmysqlclient.so.15 library. I've tried every conceivable option to "gem install mysql2" to tell it where the library is, with no luck. Note that if I have the local mysql/lib directory in my LD_LIBRARY_PATH, everything works. I just can't figure out how to tell mysql2 where the library is. Can someone help?
Thanks,
Stan McFarland
I'm sure you must also install the mysql-dev packages.
The file libmysqlclient_r.so.15 is in the mysql shared-compat package. The example below is using a specific mirror and it's for 32 bit generic linux. You can find the right package for your platform at http://dev.mysql.com/downloads/mysql/
$ wget http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-shared-compat-5.5.13-1.linux2.6.i386.rpm/from/http://mysql.mirrors.pair.com/
$ yum install --nogpgcheck MySQL-shared-compat-5.5.13-1.linux2.6.i386.rpm
That default installation path is the same that the mysql2 gem used.
On OS X, I know I always have to update the library location in the gem manually. That same trick should work fine on linux. Adjust names and paths to match your platform:
$ sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib ~/.rvm/rubies/ruby-1.8.6-p399/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle

Resources