Installing Rails on RaspberryPi (Raspbian Buster) fails - ruby-on-rails

I am still quite new to Rails(1).
Yesterday, I installed Ruby on Rails on a RaspberryPi (with a pristine SD card and fresh etched OS) the Debian way:
sudo apt-get install ruby rails
This (seemingly) successfully installed me Rails (version 5.2.2.1) and Ruby (version 2.5.5p157) and I created a new application framework without trouble. However, starting the puma server just results in a long error log.
bundle update
aborts at
installing Nokogiri 1.10.4 (was 1.10.0)
(... can't find headerr files for Ruby'...).
Not surprisingly, the server still responds with just the same error messages.
Any help in getting things up and running is highly appreciated.
Thanks!
Karsten
(1) I am absolutely sure, I am not the first and only with this question. Three weeks ago I had about the same difficulties with the installation procedure at my laptop running plain Debian. I searched for about two days without finding clear guidance (ok, not smart enough ;-). Finally I managed to get things running by manually setting GEMS versions to the pre-installed values. However, this took quite some time and because I am new, I am unaware which implications my trial-and-error settings have. Because I did not log my actions, now I would need to restart the procedure from scratch... There must be a better approach ==> sorry for redundant postings.

Try installing the headers files for ruby:
sudo apt-get install ruby-dev

Related

Ruby on Rails SSL Issue with Windows 10

I'm new to Ruby and following the course Ruby on Rails Intro on course era and on the very first chapter installing software on Windows. After installing all the required software when the instructor asks me to run 'ruby new test_install' get the following exception:
Fetching source index from https://rubygems.org/
Could not verify the SSL certificate for
https://rubygems.org/quick/Marshal.4.8/sqlite3-0.0.0.gemspec.rz.
There is a chance you are experiencing a man-in-the-middle attack, but most
likely your system doesn't have the CA certificates needed for verification. For
information about OpenSSL certificates, see "bit.ly/ruby-ssl". To connect
without using SSL, edit your Gemfile sources and change 'https' to 'http'.
I should mention that I tried with gem -a sources http://rubygems.org but to no avail and I initially installed the rails 4.2.3 by giving it --source http://rubygems.org however nothing seems to work for this particular instance of command.
So far there's no fix for this that I can find. It's not limited to Win10, either. I've come across Win7 users with the same issue, so it seems to be a Rail on Windows problem.
There are also lots of Gemfiles. It's not clear which one(s) need(s) to be changed. I've tried changing couple of them with no luck.
It does look like using Linux instead of Windows is the quickest way to a solution. It might be worth giving that a try. Other than the Mac-like weirdness of the Unity interface, Ubuntu is easy to get used to and VMWare Player is free. I wouldn't bother with Virtual Box, the versions I've tried, including the latest, have been flaky.
If you do decide to try Ubuntu, you can find instructions here: https://gorails.com/setup/ubuntu/16.04
That page recommends using MySQL or Postgres. If you do use something other than SQLite (probably a good idea, in which case Postgres is probably the better option), the creation of a new rails app requires setting the database at creation:
rails new myapp --database=postgresql
for instance.
I solved the same problem with this line:
gem install bundler
Source:
I solved the problem like this:
gem source -r https://rubygems.org/
gem source -a http://rubygems.org/
gem update

Accidentally installed Rails under sudo without RVM. How to move Rails installation and gems to RVM without breaking applications?

So I wish I had known far before that installing Rails with sudo was a bad thing. In fact, after doing my research, it appears that most people would agree that installing any type of package manager as sudo is a big no-no.
Unfortunately for me, I found this out a bit too late. I have several Rails applications that I have created and I am worried that If I try to reinstall Rails with RVM that my applications will not work because of dependency issues.
When I would install gems with bundle install, if the gem was new, Rails would ask for my password before installing it. I did not think much of it at the time, but now, I am worried nothing will work after I try booting a Rails app.
So my questions are:
If I installed Rails with sudo, will my applications still work if I reinstalled it under RVM?
If they don't work, what would I need to make them function correctly?
How do I remove a Rails installation that was installed with sudo?
Is this issue as severe as I think it is?
I had seen a lot of related posts about why one should not use sudo to install gems and Rails in general, as well as why not to do it with RVM, and pretty much not to do it all with anything Ruby related. But I have not seen a post that really addresses any of my concerns and questions that I mentioned above.
No it's not severe as you think. Applications are meant to be portable (somewhat), once you have the same dependencies installed as your development machine, they are meant to work again otherwise you wouldn't be able to deploy.
Now the main thing to check is that all your files in your rails applications are owned by user and not by sudo (otherwise you won't be able to read them later on).
Aside from it, you can simply install rvm, ensure with which ruby and which gem comes from rvm and not from your packaged ruby installation (which you can remove, I do this usually) and then simply run bundle install in your rails application, at that point they are ready to start again.

Butchered Ruby on Rails Installation

So first off, this is my first post on stackoverflow, so take it easy on me ;)
I'm a new Fedora user (f20) and I'm still in the early stages of getting used to linux. I tried to install Ruby on Rails (newest Ruby—2.1.1—and newest rails—4.1.0), using several guides I found online, which required for me to download and install several other packages. Several errors occurred towards the end of my installation so I thought I'd uninstall it and start from scratch using RVM which I hadn't done in the first place.
I tried removing the gems I installed using gem uninstall [gem_name] but I wasn't having any luck with many of them. So I decided to just sudo yum remove ruby in the hopes it would remove everything I had installed, but to my dismay the directory /usr/share/ruby still exists which makes me think that my uninstallation was incomplete.
Is there some why to completely remove any shred of ruby, rails, and gems from my computer so I can reinstall ruby on rails? Is it even necessary for me to do so in order to install a lower version of ruby (2.1.0)?
Thanks in advance.
Ok, after reading the comments I figured out the problem!
I ran a yum list | grep ruby and similar searches and found that I had not, contrary to what I believed, removed all the packages I had installed. After deleting the remaining packages my usr/share/ruby folder vanished to the sound of my yipee's!
Thanks

RailsInstaller not completing install on OS X 10.6, not responding

I'm new to Ruby on Rails and to web development in general. Yesterday I successfully installed Git, osx-gcc-installer, RVM and Ruby on my Mac OS X 10.6. To try to get Rails and everything else I need, I downloaded RailsInstaller for OS X 10.6 and apparently made it at least through the unpacking of files, but now I have the RailsInstaller Setup window hanging on my machine for over two hours. It has a message "Completing the RailsInstaller setup wizard"... "Setup has finished installing Railsinstaller on your computer." Clicking on Finish, Back, anything does absolutely nothing; the window just sits there. Clearly something is not working, and I'm not sure what to do. I checked the Rails install in the terminal and got the following message:
$ rails --help
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:in report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:inactivate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:68:in `gem'
from /usr/bin/rails:18
I'm hesitant to start killing processes or restart my machine. Also wondering if I'm going to have to purge everything I've already installed and start over from scratch, and not sure how I would go about that.
Any thoughts would be appreciated. Thanks.
I had trouble running the installer as well. It was not exactly the same issues you had.
Running the installer from the terminal as root worked much better for me.
The command would look something like this:
sudo ./RailsInstaller-1.0.4-osx-10.7.app/Contents/MacOS/osx-intel --mode text
If that does not work, you can get additional debugging diagnostics with the --debuglevel flag.

Trying to get Ruby/Rails installed on OSX Mountain Lion

This is my first question please be nice.
I've been trying to get my hands dirty with ruby/rails for a small coding project. I have Mountain Lion, and have been trying to use various techniques i've found on stackoverflow, and across the interwebs. It's not going so great! Nothing works of course. I have the system version of Ruby (1.8.7) as of now, and a bunch of broken junk from trying and failing to install Ruby!
When I install Rails via gem install, it sat for awhile... I finally learned to use -V, and noticed everything was returning back 302, and this takes forever, and finally it installs -- I get this output when I try to run rails -v
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:230:in `activate': can't activate rack (~> 1.4.5, runtime) for ["actionpack-3.2.13", "railties-3.2.13"], already activated rack-1.5.2 for ["rack-ssl-1.3.3", "railties-3.2.13"] (Gem::LoadError)
It looks like some dependencies are broken? Anyhow I'm now trying to use RVM now to get another version of ruby and setup grails with brew, This is telling me that I need a newer version of ruby to install anything pretty much?? Here is the output.
rvm install 1.9.2-head
Installing requirements for osx, might require sudo password.
Skipping brew update make sure your formulas are up to date.
Cowardly refusing to continue, please read 'rvm autolibs'.
To proceed rvm requires a ruby-1.9|ruby-2 compatible ruby is installed.
We attempted to install ruby automatically but it failed.
Please install it manually (or a compatible alternative) to proceed.
-- I am getting os frustrated here, please throw me a bone and help me out --- If I have to have to I'll setup a linux vm just to get rails running -- yet I prefer working on my mac.
Please any advice?? I just want a working version of Rails 3 on my Mac this is allThanks in advance
Please go through www.railsinstaller.org for detailed installation and setup process. This guide should answer all of your questions.
Have you tried this tutorial http://net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/
The tutorial includes all the errors you may come across during the installation.
According to this tutorial Ruby on Rail comes with the mac out of the box.
Have you tried JewelryBox? It provides a painless install method for rvm and a great little gui that helps you monitor the size of your gem sets, and installs of ruby. Along with helpful reminders to upgrade rvm. I resisted at first using it, because using a GUI made me feel like a noob, but it really is a great little tool, that makes for super easy installs of ruby, and rvm, and consequently rails.
http://jewelrybox.unfiniti.com/

Resources