Installing ruby sudo make command not found (Vagrant, Virtualbox) - ruby-on-rails

I am trying to get a development environment up and running. I installed virtualbox and then used vagrant with the hashicorp/precise32 box. I access the VM through ssh and am trying to install the latest version of ruby.
I pasted
wget -O ruby-install-0.5.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.5.0.tar.gz
tar -xzvf ruby-install-0.5.0.tar.gz
cd ruby-install-0.5.0/
sudo make install
into the command line from https://github.com/postmodern/ruby-install#readme
The prompt shows sudo make install and when I hit enter I get a message that says "sudo: make: command not found."
What am I doing wrong?
I know there are boxes with ruby already setup but I wanted to go through the process myself so learn a bit along the way.
A separate issue I came across was that this box has an outdated version of ubuntu. When I try to upgrade it warns me not to do it over SSH. Is there a better way?
Thanks

Maybe you don't have make installed on Ubuntu. You can install the package build-essential which will install make and other building tools.
sudo apt-get install build-essential
also, here's a good reference on installing Ruby, Ruby on Rails, and other tools on Ubuntu.

Related

While installing Homebrew, connection failed error comes up when run this command " sudo apt-get install build-essential". What to do about it?

I am just starting with web3 development. I have installed WSL. Then I opened Ubuntu and installed Homebrew. When the installation is almost complete it asks for next steps which is providing the path and installing the dependencies. After providing the path when I ran this command "
sudo apt-get install build-essential" it gave me connection failed error as shown in the pic.
Then I turned Windows Defender off and tried again but didn't work.
Then I tried to paste the same url in my browser but it didn't work. My guess is that url is different or wrong, but I don't know.
I also tried running this command "sudo apt-get update" but it also gives the same error.
Same error with this as well "sudo apt-get install build-essential procps curl file git"
Any idea what to do about this?
Note:- Just wanted to let you know that When I check "brew -version" it shows me my version 3.4.11. And my Ubuntu version is 20.04.

How to uninstall RVM in Ubuntu 18.04 completely?

I tried uninstalling rvm in Ubuntu LTS 18.04 using the following command:
rvm implode
After uninstalling, I tried installing it again using the following command:
sudo apt-get install rvm
But re-installation was unsuccessful and when I run rvm I get the following:
rvm: command not found
What are the steps to correctly remove rvm?
After the command rvm implode you should run gem uninstall rvm to make sure there's nothing left in your Ruby system install pointing to your rvm folder.
Usually, in order to remove what you have, sudo apt-get remove rvm should suffice, else try adding the --purge flag like in sudo apt-get remove rvm --purge. I understand you wanted to use the built-in command though. I don't know where you found the instructions you have followed, but it's weird that they didn't insist on the next step (uninstalling the gem).
For reinstalling, RVM has a dedicated Ubuntu package.
My advice is to do what I did to install it on my work computer, which was running Ubuntu. It's all listed here, but to take you through it:
Add the offical repository, update and install
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm
You'll have a group 'rvm' among your user groups. Add your user to it
sudo usermod -a -G rvm <yourusername>
In the link I included you'll find the instructions to have your terminal (assuming you're using Gnome as your Desktop Environment) login every time you reboot, enable local gems, install and change versions of Ruby and more.
According to the official information it souldn't work with just apt-get.
Visit this page and follow the steps.

Error installing Ruby gem Jekyll [duplicate]

I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link. I think it's an update to Ruby, but RVM is having trouble installing alternate versions of ruby as well.
Heres the full post:
$ sudo gem install jekyll
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out
Does this mean I need to update the version of ruby I'm using via rvm?
Ubuntu
sudo apt-get install ruby-dev
gem install jekyll
Your problem is that either you system doesn't know where make is located at or you don't have it installed. The easiest way to fix this (and probably other issues you'll run into trying to get a ruby system up and running) is to install xcode.
You can get it at http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 for lion. Or it came on a CD with your computer for earlier versions.
If you're using Lion, please see comments below for a link to how to install developer tools on Lion.
I had the same error on Ubuntu and this helped me sort it out.
You must have ruby-dev installed
apt-get install ruby-dev
If you installed XCode and command line tools are still missing go to Terminal and
xcode-select --install
it will prompt you to install these tools. After that just follow SrBlanco´s answer. That solved the problem for me.
Good luck.
Need to install "make".
I am using Ubuntu 12.10.
sudo apt-get install make
Should work on any Debian based distro.
Note: this problem also occurs on newer MacBook Pro models that come with Mavericks pre-installed. I updated another post with my own solution that didn't involve Xcode at all. My system had the Xcode developer tools installed when I got the machine.
ERROR: Error installing jekyll: ERROR: Failed to build gem native extension
Install Xcode as mentioned if you don't have it installed already (https://developer.apple.com/xcode/). Plus you need the command line tools.
Open Xcode. Go to Preferences > Downloads > Install Command Line Tools
Installing command line tools for Xcode solved the problem for me on my Mac
xcode-select --install.
sudo apt-get install ruby-dev
sudo gem install jekyll
hope this will help, it works with me.
I had this same exact error when trying to install Jekyll, and the following steps from this link helped me. Just in case anyone else comes across this!
http://davidensinger.com/2013/03/installing-jekyll/
I was facing the same issue in my Fedora 22 setup. I had ruby installed but didn't have ruby-devel. Installing ruby-devel fixed the issue for me.
dnf install -y ruby-devel
For older systems:
yum install -y ruby-devel
I followed this on Ubuntu/Linux Mint
sudo apt install build-essential
sudo apt install ruby-dev
sudo gem install jekyll
An addendum: You can install XCode now from the App Store on Mountain Lion. The process is transparent and pretty fast.
I had the same problems with you.
I use Mac OS X 10.9 develop preview version, and I had installed gcc and Xcode.
But my Xcode version is 4.6.
Then I install the Xcode 5.0
After that I type sudo gem install jekyll in the terminal again. Then it works.
Wish it could help someone.
Installing Xcode and going to perferencs > downloads > install commandline tools WORKS!
Same problem on Debian, I had forgot to run this command:
~/.rvm/scripts/rvm
All these answers did NOT work for me.
If you're looking for a solution on ubuntu 14.04, do this:
sudo apt-get install ruby1.9.1-dev zlib1g-dev nodejs
sudo gem install jekyll -v 2.5.3
Unfortunately, nodejs is required because of a bug in Jekyll that enforces existence of runtime JS engine even though it doesn't need one.
For Ubuntu, this helped in my case:
apt-get install libffi-dev
A general advice is to just follow what is displayed as the reason for the error and hopefully you'll be provided with a log file in which the first line suggests which package should be installed, in my case:
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/mkmf.log
MacOS
my solution to this problem
install xcode
type xcode-select --install in the command line
type sudo gem install jekyll in the command line
PS: It is the combination of the two answers in this question.
You are missing the ruby-dev file , just go ahead and run this command - sudo apt-get install ruby-dev
Hope this helps!!
I had the same issue on my macOS(10.14.2), the reason may be:
Apparently with OSX el Capitan, there is a new security function that prevents you from modifying system files called Rootless.
My solution is using rvm:
install ruby on Mac OS X with RVM
gem install jekyll
On windows I have this issue
I actually installed the version rubyinstaller-devkit-2.6.3-1-x64 of ruby
I have removed the ruby completely and Installed the rubyinstaller-devkit-2.5.5-1-x64
and issued the following commands on powershell
gem install bundler
gem install jekyll
and this time no errors where found
I had this issue and of all things, the error was occurring because I hadn't agreed to some updated terms of service in xcode. Running the following did the trick for me. Go figure.
sudo xcodebuild -license accept
For me, I had to upgrade homebrew and install rbenv to the latest ruby version. After that, I followed the instruction at jekyll website. My OS is Catalina 2019, I couldn't install Xcode, which is not compatible yet!
You have to set the path in your .bash_profile to make sure that it initializes the rbenv when you restart your terminal.
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
then
$ rbenv version
2.2.3 (set by /Users/mislav/.rbenv/version)
$ rbenv shell
rbenv: no shell-specific version configured
hope that help!
Here is the (only?) reliable and simple way to install Jekyll on macOS
Install UTM
Install Ubuntu Server
Install Jekyll using Ubuntu instructions at https://jekyllrb.com/docs/installation/ubuntu/
Forward port 22 in the VM settings (22->localhost->22)
Use VS Code on the macOS host
Install Remote SSH
Connect to USER#localhost
Drag and drop the folder on Mac into VS Code (this transfers files to remote)
Enable port forwarding for 4000 (bottom bar on VS Code)
Work on your website
Right click on your website on the file explorer and click download
If you have not done these steps, you might be delighted by:
Ubuntu imports your public SSH key from GitHub
VS Code magically handles file transfer in and out
VS Code magically installs your VS Code extensions onto the remote server and allows file search on the remote host

Installing Ruby on Rails on Linux mint?

When I used "sudo apt-get install ruby-full build-essential" in the terminal I got this:
$ sudo apt-get install ruby-full build-essential
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/packages.medibuntu.org_dists_quantal_non-free_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
Can anybody tell me how can I install Ruby on Rails in my Linux Mint machine?
I think you don't need features of rvm. You just want to install ruby easy, fast and without troubles, right? Good news to you. We got an alternative to rvm. It's called rbenv. You can find an installation guide here.(don't skip ruby-build, it is necessary!).
And yes, follow ubuntu instructions since Mint is build on it (though there's debian-based version but I suppose you use ubuntu-based one).
I installed yesterday Mint 16 and rbenv on it. Works fine.
PS: don't forget to sudo apt-get install build-essential first.
I actually use Mint on my main development system. I'd also recommend using RVM to manage all your Ruby and Rails installation/versions. The command to install it is:
\curl -L https://get.rvm.io | bash -s stable
You can also append --ruby and --rails to get (I believe) the most recent versions of the two of them. I'd recommend not using apt-get for installing Ruby, as I've noticed that it can be out of date and/or lead to strange errors like those that you're seeing. You can get more information from the RVM website. I really enjoy using Mint, so I hope that helps.
Use rvm to install Ruby then simply install rails gem , but before that fix your repository related problem.
sudo rm -rf /var/log/apt/list
sudo apt-get update
sudo apt-get upgrade
Then install rvm see rvm.io for installation info
If you are new want to setup everything from start then see this blog post
https://www.computersnyou.com/4235
Use rbenv
instead, use this link DigitalOcean since mint is an ubuntu based distro, it will work.

installing ruby on rails from development onto production server

I have been developing rails applications on windows xp. I now need to deploy these apps to a different computer, which has Ubuntu 10.04.1 LTS. To install ruby and rails on my windows machine, I used the RailsInstaller. I now need to get ruby and rails working on my Ubuntu machine. It isn't connected to the internet so pretty much every tutorial I found hasn't worked. Can I just transfer my installed files from my windows machine? In my RailsInstaller directory on my windows machine, there is the following directories: DevKit, Git, Ruby1.9.3, and scripts. It also has unins000.exe and unins000.dat. Will it work to just transfer these files or is there some other way to get ruby on rails working on my Ubuntu machine?
Windows and Ubuntu are two different operating systems. Read about operating systems here
You cannot copy software files from one Operating system to another. You can only move code and documents (images, music etc).
Anyway, since you are using Ubuntu, the tool that allows you to install software is called 'aptitude'. You will install software 'packages' from the terminal. It is similar to the command prompt in windows. You can open it by searching in the dash.
The command to install software is apt-get install package-name. You need to give it root privileges so you will have to prefix the command with sudo.
By default aptitude will fetch package from online repositories. But you can also make it install from a local file.
Another way for offline installation is to get the '.deb' package file of the software and run dpkg -i filename.deb.
Okay. So the idea is to download the software packages needed for ubuntu and use the installation tools provided to install them.
Ok For Ruby we have something called Ruby Version Manager or RVM. It allows you to have multiple versions of Ruby on your computer. I think that wont be necessary for you. But still we will go with RVM because of its ability to let you install ruby offline with ease.
Read more here: http://rvm.io/rvm/offline
As you might know, Rails is a gem of Ruby. In the above link you will find how to install Gems offline. Just download the Rails gem and install it using the local option of bundler. Ok I might have confused you with this paragraph. But you read the RVM documentation and you will understand.
If you do get an internet connection, there is an awesome tutorial (step by step) at DigitalOcean.com to guide you.
https://www.digitalocean.com/community/articles/how-to-install-ruby-on-rails-on-ubuntu-12-04-lts-precise-pangolin-with-rvm
I know its for Ubuntu 12.04. But you wouldnt face much problem.
Good luck. And learn about operating systems.
Installation of Ruby on Rails for Production server is pretty straight forward. Below are the relevant steps.
1.INSTALL THE NEEDED LIBRARIES
sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18 libmysqlclient-dev libyaml-dev
2.DOWNLOAD AND INSTALL RUBY 1.9.3
sudo apt-get update
sudo apt-get install ruby1.9.3
Note you can install latest Ruby too.
3.INSTALL RAILS
sudo apt-get install ruby-dev
sudo apt-get install build-essential g++
sudo gem install railsconfigure rails application with nginx and unicorn
4.INSTALL SQLITE ADAPTER
sudo apt-get install libsqlite3-dev
If you passed all above steps without any ERROR, Now it's time to create a rails demo application OR SCP existing one and test it out.
Below is the steps to create new rails application
rails new demo
cd demo
uncomment therubyracer gem in Gemfile
sudo apt-get install build-essential g++
bundle install
rails g scaffold order name:string
rake db:create
rake db:migrate
Open config/routes file and uncomment root 'welcome/index' and replaced with 'orders/index'
$rm -rf public/index
That's all, Now run your Rails application.
Checkout http://railscasts.com/episodes/335-deploying-to-a-vps and search for "capistrano" to deploy. It's an art.
"It isn't connected to the internet so pretty much every tutorial I found hasn't worked"
You are way off the beaten path here. but if you can get your git repo to a machine that is connected to the internet, you can deploy to Heroku easy, and/or run capistrano from there.

Resources