Skip to content

Instantly share code, notes, and snippets.

@mh-github
Last active January 23, 2019 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mh-github/6549d17fece34b2dee816dfaa45298e7 to your computer and use it in GitHub Desktop.
Save mh-github/6549d17fece34b2dee816dfaa45298e7 to your computer and use it in GitHub Desktop.
Rails (with MySQL) environment on Windows 10
Ran the above two commands repeatedly
$ sudo apt update
$ sudo apt install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev
Install rbenv
$ cd
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec $SHELL
$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
$ exec $SHELL
$ rbenv install 2.3.1
$ rbenv global 2.3.1
$ ruby -v
$ gem install bundler
$ cd /mnt/d/Code
$ sudo apt install mysql-client libmysqlclient-dev
file my.cnf
[client]
protocol=TCP
file /config/database.yml
development:
database : my_development_database
host : 127.0.0.1
Error: Could not find proper version of railties (4.2.6) in any of the sources
$ bundle install
This installs missing gems
Start MySQl on Windows
Create database my_development_database
$ bin/rake db:migrate RAILS_ENV=development
nodejs is required.
$ curl -sL https://deb.nodesource.com/seetup_8.x | sudo -E bash -
$ sudo apt install -y nodejs
$ gem install rails -v 4.2.10
$ rbenv rehash
$ rails -v
When you create a new Rails app, you might run into the following error: parent directory is world writable but not sticky.
If you run into this issue, you can run
$ chmod +t -R ~/.bundle
and that should fix the permissions errors and let you finish the bundle install for your Rails app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment