Git Product home page Git Product logo

setup's Introduction

In Chinese?

如果你在参加中文课程,请打开中文设置指南

¿En Español?

Haga clic en este enlace para acceder a la versión en español de la configuración.

Em Português?

Clique neste link para acessar a versão em português da configuração.

En Français ?

Clique sur ce lien pour accéder à la version française du setup.

In English

Setup guides for Le Wagon Web Development course. Please choose your operating system (OS):

macOS Windows Ubuntu

setup's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

setup's Issues

Rails testing does not work

With the default configuration for the tests, we end up with the error
Selenium::WebDriver::Error::UnknownError: unknown error: cannot find Chrome binary

"no valid sudoers sources found" Error

When doing the second-setup on Mojave (10.14.5) students get the following error message when trying to sudo:
Image from iOS

No issues reported when following the regular setup.My (uneducated guess) guess is that the culprit is this line here, found only on the second setup:

sudo chown -R $(whoami) $(brew --prefix)/*

Can someone take a look?

Installing necessary gtk components

Sublime needs some graphical components from the GTK libraries that apt isn’t smart enough to download automatically. We can install them with this command:

sudo apt-get install libgtk2.0-0

Student needs to restart terminal after.

Incompatible marshall format

I got this error when running the following line on both linux and mac:

gem install rake bundler rspec rubocop rubocop-performance pry pry-byebug hub colored octokit

ERROR: While executing gem ... (TypeError) incompatible marshal file format (can't be read) format version 4.8 required; 60.33 given

The following seemed to work:

gem sources -r http://gems.rubyforge.org/
gem sources -r http://gems.github.com
gem sources -a https://rubygems.org/

From this article: rubygems/rubygems#1589

Seems like an issue with gem sources - just flagging it as I've experienced it twice now on different systems...

Getting The Correct Ruby Fails on My Setup

Following the wiki step by step, once coming to the Ruby setup (https://github.com/lewagon/setup/blob/master/second-setup/OSX.md#ruby), I run all the requisite scripts and my computer never recognizes the latest ruby version. I run into this issue on every attempt dev env setups that I have done.

➜  ~ ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
➜  ~ rbenv install 2.5.3
rbenv: /Users/Brian_Welch/.rbenv/versions/2.5.3 already exists
continue with installation? (y/N) N
➜  ~ rbenv global 2.5.3

Quit and reopened terminal.

➜  ~ ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
➜  ~ rbenv version
2.5.3 (set by /Users/Brian_Welch/.rbenv/version)
➜  ~ rbenv versions
  system
* 2.5.3 (set by /Users/Brian_Welch/.rbenv/version)
➜  ~ rbenv shell
rbenv: no shell-specific version configured

As it turns out, I actually need to install ruby 2.4.4 for the existing web app that I am going to connect to from my github repo...

➜  ~ rbenv install 2.4.4
ruby-build: use openssl from homebrew
Downloading ruby-2.4.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.4.tar.bz2
Installing ruby-2.4.4...
ruby-build: use readline from homebrew
Installed ruby-2.4.4 to /Users/Brian_Welch/.rbenv/versions/2.4.4

➜  ~ rbenv versions     
  system
  2.4.4
* 2.5.3 (set by /Users/Brian_Welch/.rbenv/version)

But the issue stands, rbenv is not 'pointing' at the right ruby version.

Hub browse doesn't work

Hello,

In WSL, hub browse will render the error Please set $BROWSER to a web launcher to use this command

Fix:

For Google chrome browser
echo "export BROWSER=/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe" >> ~/.zshrc
Restart your terminal
hub browse should now open chrome

For Firefox browser
echo "export BROWSER=/mnt/c/Program\ Files\ \(x86\)/Mozilla\ Firefox/firefox.exe" >> ~/.zshrc
Restart your terminal
hub browse should now open firefox

issue with shrinking volume

if you have issues with shrinking volume showing much less space possible than available

Contrary to other answers, this IS possible, but can be challenging.

Why might you want to do this? Windows often places the MFT in the middle of the disk for historical performance reasons - this can prevent shrinking of a volume as Windows won't shrink the volume beyond un-movable files (of which the MFT is one).

Here's the steps I've just used to move my MFT to allow me to shrink my system volume:

Run Disk Cleanup
Disable System Restore
Disable the page file
Disable hibernation
Run PerfectDisk (free trial is fine for this purpose) - make sure you do a boot-time defrag - this will move the MFT
Run a defrag utility (my preference is Piriform's Defraggler) - after defrag the drive map should now show plenty of free space at the end of the disk
Shrink the volume using the Windows Disk Management utility
Enable hibernation
Enable page file
Enable system restore

Provide a cloud-based development setup

Gitpod.io provides dev environments (read: editor and terminal) as a service. You can configure which command line tools you want and it is based on VS Code. It is ideal for trainings as it removes the setup friction and all the works-on-my-machine hassles.

If you are interested I would be happy to provide you a demo for one of your repositories. Gitpod is free for public repositories. 🌞

Mac OS Setup

in the second install tutorial this line is missing:
gem install rake bundler rspec rubocop pry pry-byebug hub colored octokit

(copied from the first setup tutorial)

Windows/Ubuntu wiki

Teachers are facing recurrent issues about while installing Ubuntu on windows. We need to bring them clearer solutions. A wiki could be good.

add spring watchers setup for ubuntu

this happens consistently on a fresh ubuntu setup

FATAL: Listen error: unable to monitor directories for changes.
Visit https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers for info on how to fix this.
Exiting

Alumni Setup is only for OSX

Following the link on the main setup repo for Alumni takes you here, which only details OSX setups, and not Linux/Windows setups.

(fixed) " No such widget `autosuggest-history-substring-search-up` "

after zsh installation I can't use anymore the "up" button to get the commands history :

No such widget "autosuggest-history-substring-search-up"

How I fixed it with the help of this thread:

  1. stt .zshrc

  2. move the key listener

# Enhance history with substring search and purple highlighting
bindkey '^[OA' history-substring-search-up
bindkey '^[OB' history-substring-search-down

before the plugin sourcing:

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
plugins=(gitfast brew rbenv last-working-dir common-aliases sublime zsh-syntax-highlighting zsh-history-substring-search)
  1. save file and restart terminal

Oh-my-zsh command history doesn't work in Ubuntu

Link:

https://github.com/lewagon/setup/blob/master/UBUNTU.md#oh-my-zsh---fancy-your-terminal

Issue:

Oh-my-zsh command history doesn't work in Ubuntu (tested on 18.10 and 19.04)

Solution:

After

sudo apt install -y zsh curl vim nodejs imagemagick jq
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# it will ask for your session password

add the following to test the command history file $HISTFILE

ls -l $HISTFILE
# if result shows
-rw-r--r-- 1 root root 4200 Nov 24 09:45 /home/"your_username"/.zsh_history
# then execute $sudo chown user:group $HISTFILE
# which in most case is
sudo chown $USER:$USER $HISTFILE

This solved the problem for me.

WSL and access rights

We need to investigate access rights with WSL setup.
2 related issues have been spotted:

chmod 0770 ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
  • warning: Insecure world writable dir inside /home/[USER] directory fixed by
sudo chmod -R go-w /home/[USER]

advanced setup

I propose to add rails, PG and node.js install to lewagon's setup in case of being an alumni and need to configure your brand new mac/pc from scratch ;)

Mac

Install Node.js

$ brew install node

Install Rails

$ gem install rails
Quit (⌘ + Q) and restart your terminal when it's done.

Install PostgreSQL

$ brew update
$ brew install postgresql
$ mkdir -p ~/Library/LaunchAgents && ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
$ launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Linux

Install Node.js

$ sudo apt-get install node

Install Rails

$ sudo apt-get install nodejs ⚠️ this is from karr but I'm not sure!!

Install PostgreSQL

$ whoami
$ sudo apt-get install postgresql postgresql-contrib libpq-dev build-essential
$ sudo su - postgres
$ psql
> create role "XXXX" login createdb; # Replace XXXX with the result of whoami
> \q
$ exit

Order problem with setup ZSH

The setup indicates when installing XMing to:

echo "export DISPLAY=:0.0" >> ~/.zshrc

but oh-my-zsh is not installed yet so the file ~/.zshrc does not exists yet.

This command should be moved after oh-my-zsh is installed.

Run the git installer

Then run the git installer:

cd ~/code/$GITHUB_USERNAME/dotfiles
zsh git_setup.sh

I completed all the previous steps, but there's no git_setup.sh file here. Here's what I have:

  • README.md
  • gitconfig
  • irbrc
  • vimrc
  • aliases
  • gitignore
  • rspec
  • zshrc
  • gemrc
  • install.sh
  • tm_properties

Can't chown /usr/local in High Sierra

Homebrew/brew#3228

I ran into the same problem as above issue ☝️ setting up new MacBook with High Sierra.
I tried following line as mentioned in the response to the issue, and it worked for me 👍
sudo chown -R $(whoami) $(brew --prefix)/*

Should WSL have it's own link in the readme?

It seems there is no direct link to WSL setup guide from the setup repo readme, or the Windows setup readme.

Last batch this lead to some students not knowing that WSL is an option during setup day.

Suggested fix: On the repo readme, include an image that links to the WSL setup, next to MacOS, Ubuntu and Windows images.

Get BIOS boot from Windows 10

Feedback to get BIOS setup from advanced mode boot with Windows 10.
I had to do this:
On Windows:
Settings -> Update & security -> Recovery
Click on Restart now
From advanced mode boot:
Troubleshoot -> advanced options -> UEFI Firmeware settings -> Restart
From here you get the BIOS setup

Bitlocker Encrypted drive (Dell laptops) breaks dual boot

It is common practise for Dell to encrypt their drive with Bitlocker.
If you install Ubuntu on dual boot on it (it'll work), you'll have to type the encrypt key every time you want to boot on Windows again (it's 48 characters and there's no copy paste)

So before the setup, for the dell laptop, we'd need to check if the drive is encrypted, and if it is, decrypt following this tutorial:

http://users.isr.ist.utl.pt/~mbayat/hacks/how-to-remove-bitlocker-encryption-in-windows-10/

Postgresql installation fails with apt-get

The old ballad of "postgresql installation fails either with apt or with apt-get".

Today the culprit seems to be apt-get, so, as the Debian eco system is moving more and more towards apt (with the -get), I would say, that we go full s/apt-get/apt/g 🤷‍♀️

$PATH rbenv zsh

Setup tutorial(rbenv part) ask to run :sudo apt-get install -y build-essential tklib zlib1g-dev libssl-dev libffi-dev libxml2 libxml2-dev libxslt1-dev libreadline-dev sudo apt-get clean git clone https://github.com/rbenv/rbenv.git ~/.rbenv git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
But sometime Zsh dont update the $path to understand 'rbenv' which result in a 'command not found' error.
To manually reasign the $PATH you need to run :
`$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshenv

$ echo 'eval "$(rbenv init -)"' >> ~/.zshenv

$ echo 'source $HOME/.zshenv' >> ~/.zshrc

$ exec $SHELL`

no step to install rails in second setup for OS

These are steps:

  1. install Ruby
  2. restart terminal
  3. check Ruby version
  4. install gems rake bundler rspec rubocop pry pry-byebug hub colored octokit
  5. check Rails version

So there is no step of installing rails before checking the version

PostgreSQL autostart

Hi,

with the new Ubuntu /etc/rc.local isn't working for autostart purposes anymore.

The simplest way I could find would be

sudo echo "`whoami` ALL=NOPASSWD:/etc/init.d/postgresql start" | sudo tee /etc/sudoers.d/postgresql
sudo chmod 440 /etc/sudoers.d/postgresql
echo "sudo /etc/init.d/postgresql start" >> ~/.zshrc

Sincerely,

Malte

"sudo apt-get -y install" versus "sudo apt -y install"

Hello,

During the setup, sometimes it says one and sometime the other
I think we should just pick one and be coherent throughout the setup

sudo apt-get might be the one they'll see more online if they look up issues 🤔

$ zsh git_setup.sh > doesn't work

zsh git_setup.sh the file can't be found
seems like the processes here have been included in the previous command zsh install.sh if I get it well

yarn too old for webpack

Hello,

For the students running WSL, following the instructions under the Oh-my-zsh paragraph:
sudo apt-get install -y nodejs will install them the v4.2.6 which is outdated and they'll get an error when doing rails new app_name --webpack

Fix:

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs

Issues with setup

Hello,

I am currently facing 2 issues with this setup (my computer uses Ubuntu 16.04 LTS) :

  1. I need to add the following command to login into GitHub (otherwise I have an error "Permission denied (publickey).") :

$ ssh-add ~/.ssh/id_rsa

  1. The following command doesn't seem to work :

$ psql --command "CREATE ROLE whoami LOGIN createdb;"

I have the following error : "ERROR: role "postgres" already exists". However, replacing whoami with my usual login seems to work.

In macOS, Ruby is installed to the not recommended folder by rbenv because of oh-my-zsh plugin file.

By default, Ruby is installed to /Users/user_name/.rbenv/versions, but actually in my PC (and probably other Le Wagon student using macOS) Ruby is installed to /usr/local/Cellar/rbenv/1.1.0/versions/ because of zsh plugin /Users/user_name/.oh-my-zsh/plugins/rbenv/rbenv.plugin.zsh.

mislav recommended us to install Ruby to /Users/user_name/.rbenv/versions.

Some PRs for zsh are created but not merged yet.

To solve this problem, it may work that before installing Ruby, comment some lines of zsh plugin code out as this PR.
I'll try it from now, after trying I'll post the result.

Related issues:
ohmyzsh/ohmyzsh#3093
ohmyzsh/ohmyzsh#4998

Related PRs:
ohmyzsh/ohmyzsh#3808
ohmyzsh/ohmyzsh#4384
ohmyzsh/ohmyzsh#6168

Mac OS Mojave gem installation line

When running the line for installing gems:
gem install rake bundler rspec rubocop pry pry-byebug hub colored octokit
I ran into an error due to having OS Mojave - think it was related to this:
https://stackoverflow.com/questions/54786580/error-while-executing-gem-typeerror-incompatible-marshal-file-format-can, and was fixed by updating the gem sources.

Thought I would let you know in case this is something that needs updating on the docs or whether it was just for my computer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.