![]() ![]() If not, remember to copy and paste the entire error log into a document that you can share with your instructor. You should see a message similar to the following: Puma starting in single mode. Once it's complete, cd into test_project and start the Rails server: $ rails s It will take a little time for Rails to spin up a new project. You can verify that Rails is working by navigating to the desktop and creating a new project: $ rails new test_project In your Terminal, run this command to verify the version of Ruby you've installed: $ ruby -vĪlso, confirm that you can access IRB (a REPL, which we'll learn more about soon): $ irbįinally, verify that you can install Rails at the same version we use at Epicodus: $ gem install rails -v 7.0 Optionally, run this command: $ echo "gem: -no-rdoc -no-ri" > ~/.gemrc Why? It takes longer than installing the gems themselves, and better documentation is available online. The last configuration I'd recommend is to not install documentation when you install Ruby gems. To set your default Ruby version to 3.1.2, run this command: $ echo "ruby-3.1.2" > ~/.ruby-version ![]() $ echo 'source /usr/local/opt/chruby/share/chruby/auto.sh' > ~/.zshrc $ echo 'source /usr/local/opt/chruby/share/chruby/auto.sh' > ~/.bash_profileįor zsh users: $ echo 'source /usr/local/opt/chruby/share/chruby/chruby.sh' > ~/.zshrc This will set up bash or zsh to use chruby and also set up auto-switching of Ruby versions.įor bash users: $ echo 'source /usr/local/opt/chruby/share/chruby/chruby.sh' > ~/.bash_profile Next, configure your shell's environment variables for chruby by running the following two commands. To install chruby, a program to manage which versions of Ruby you're using, run this command: $ brew install chruby Alternatively, once you are using VS Code, you can use $ code ~/src/ to open the directory in VS Code, look at the Ruby source code there, and remove it manually. As always, be very careful using the $ rm -rf command. Optionally, you can run $ rm -rf ~/src/ to remove the source code that ruby-install downloaded as you won't need it anymore. If you get the following error configure: error: clang version 3.0 or later is required, you'll need to install Xcode developer tools first: $ xcode-select –-install To install the version of Ruby we use at Epicodus, run this command: $ ruby-install ruby 3.1.2 To install ruby-install, a tool for installing Ruby, run this command: $ brew install ruby-install $ echo 'export PATH=/usr/local/bin:$PATH' > ~/.zshrc $ echo 'export PATH=/usr/local/bin:$PATH' > ~/.bash_profile Next, ensure Homebrew packages are run before the system versions of the same (which may be dated or not what we want) by executing the following: This installs Homebrew on your device, a package manager for OS X that makes it easy to install developer software. If you do not have Homebrew installed yet, you may install it now by copy and pasting this command into the command line: $ /bin/bash -c "$(curl -fsSL )" ![]() You may stay with RVM if it is working for you but we recommend using chruby and ruby-install, which we will go over here. If you have installed Ruby before, you may be using RVM (Ruby Version Manager). We'll install Ruby using chruby and ruby-install. You can share these notes with your peers, and they can share their notes with you. Take note: if you run into any error that prevents you from completing all of the installation steps in this lesson, you should still continue with the remaining installation pre-work by installing Postgres.Īlso make sure to take detailed notes on any issues that come up, the troubleshooting steps you took to address those issues, and any helpful resources you found along the way. In this lesson, we'll cover installing the version of Ruby and version management tools that are used on Epicodus computers. Instead, they configure several systems to help them manage Ruby installation (and other programs), and manage different versions of Ruby. Most developers don't use the pre-installed version of Ruby on their Macs. If you're using Ruby on a Mac, it is set up by default, but you can't modify or upgrade it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |