FarmBot / Farmbot-Web-App

Setup, customize, and control FarmBot from any device
https://my.farm.bot
MIT License
891 stars 329 forks source link

Issue while following instructions to install an instance locally #870

Closed derletztename closed 6 years ago

derletztename commented 6 years ago

Expected Behavior

bundle install to run smoothly

Actual Behavior

error because installing nokogiri failed

Steps to Reproduce

After installing all prerequisites necessary on my raspberry pi 3 with "ubuntu-18.04-preinstalled-server-armhf+raspi3.img.xz" (from https://wiki.ubuntu.com/ARM/RaspberryPi), I followed the instructions and got the error at "bundle install"

Results of git log -1

I am not a coder and don't understand that, sorry.

Run git log -1 and paste the results here. Neither that, but here is a helpful screenshot: img_20180529_215754

RickCarlino commented 6 years ago

@derletztename Please try running the server on a traditional x86 based computer (eg: a desktop).

You will hit numerous issues trying to run a server on a Pi. Common issues reported when running a web server on a Pi:

derletztename commented 6 years ago

If you want to use the farmbot off grid, you need either a really big internet flat rate (I recently learned there is a lot of data tranfer necessary just by using the farmbot) or an "offline" Web-App server. And I can't easily put a regular PC on a field. Do you have any recommendation for a tiny x86 PC that could be used on a field as a server with reasonable pricing? One could use the UDOO (https://www.udoo.org/udoo-x86/), but it's not cheap as a raspi and I don't know if it fits your server requirements (are they listed somewhere?) Or maybe a LattePanda board? (https://www.lattepanda.com/products)

RickCarlino commented 6 years ago

@derletztename Any x86 based processor with at least 4gb of memory at a few gigabytes of storage will suffice. You might be able to go as low as 2gb of RAM, but 4 is ideal (I've seen servers hit issues with only 2gb).

I have never worked with a Udoo board, but it looks like the "advanced" model just barely meets the specs. Another option (if you are on a very tight budget) would be to search locally for used desktop computers. There are often many available locally that will easily meet the specs and are often cheap (less than the cost of the Udoo) or free.

derletztename commented 6 years ago

The issue is more to power the server and protect it from the weather on the field. It would be helpful if the server runs on 12V and fits under the solarpanel housing. I did some research, what do you think of this pc: https://www.zotac.com/ae/product/mini_pcs/zbox-ci325-nano It got wifi, you can fit enough ram in and with a tiny transformer it can be used with 12V and consumes only small amounts of energy. Also it's passive cooled, so less vulnerable to the dust, etc on the field

derletztename commented 6 years ago

So I bought that Zotac x86 PC and installed Ubuntu Server, the amd64 version, on it. And I ran into the same exact problem than before. I guess it's not related to the ARM architecture then? Could you please help me getting your software to run @RickCarlino, the plant are growing and I can't use the farmbot without the server as it is off grid and farmbot software needs more data than I can spend money on mobile data contracts. Also I wanted to modify the server to take pictures regularly and save them on that server...

RickCarlino commented 6 years ago

@derletztename For some reason, your system can't find ruby.h, which I don't see often on rvm based installations.

Please run the following and send me a screenshot:

lsb_release -a
rvm list

Also, how did you set up the pre-requisite packages? Did you use ubuntu_example.sh?

I wanted to modify the server to take pictures regularly and save them on that server

You won't need to modify the server for this. A regimen or farm event should work fine for such a task. Please direct any questions about this to the forum as Github is intended for software development related questions.

derletztename commented 6 years ago

img_20180601_224116

Thx for answering so fast. I think I made a mistake installing ruby/rvm? I did not use ubuntu_example.sh, I don't even know what this is. I just installed package after package with apt-get install. I did what you asked for and added the screenshot, but I guess I have to install rvm and not ruby?

derletztename commented 6 years ago

After installing rvm (following https://github.com/rvm/ubuntu_rvm) I was able to install ruby with rvm in a different way. I guess this will fix the issue. I'll comment again when it's finished

derletztename commented 6 years ago

Now, after installing rvm and with that ruby 2.5.1 and doing a reboot and apt-get update, I still was not able to install with bundler. It's the exact same error :( Also (at first ruby-2.4.1 was installed) after deleting ruby-2.4.1 and setting ruby-2.5.1 as default, there still is the same error :(

RickCarlino commented 6 years ago

@derletztename Try

sudo bundle install

instead of bundle install.

If that doesn't work, try re-flashing Ubuntu and using with these instructions. It is difficult to pinpoint the exact differences between systems, so starting with a fresh installation of Ubuntu 18.04 and following the directions in that file will help eliminate some of the uncertainty.

derletztename commented 6 years ago

I tried sudo bundle install, without it hadn't even started before. So then I completely reinstalled and tried following your instructions, but failed at the very first bit, because it won't install docker this way. I am using Ubuntu Server 18.04 LTS... do I have to switch back to Ubuntu 17 to get it running?

derletztename commented 6 years ago

There is no Ubuntu 17 on the Ubuntu download site: https://www.ubuntu.com/download/alternative-downloads

RickCarlino commented 6 years ago

@derletztename

it won't install docker this way.

Please show me the errors.

There is no Ubuntu 17 on the Ubuntu download site

Ubuntu 18 should work. I just installed on Ubuntu 18.04 this week without issues (it was a Desktop edition machine, but server edition has worked fine in the past).

I am going to take a closer look at the configuration issues today. I will let you know if I find anything.

derletztename commented 6 years ago

Hey sorry I forgot to write again. So the issue with docker was I mistyped apt-key with apt-get. Shame on me :( I installed all the things on this list and had no more issue. But when I tried to start the server with "bundle exec rails api:start" it told me there is no bundle installed on my machine and I lost it. I gave in for the rest of the weekend and will ask an software expert tomorrow

RickCarlino commented 6 years ago

@derletztename

Usually, when things like bundle go missing, it is because rvm is not using the correct ruby version. Make sure that RVM is on the correct Ruby version (rvm use 2.5.1) and try again.

derletztename commented 6 years ago

Today a friend of mine helped me out and now we finally got it running. The issue was that line 17 has to be fitted slightly (source /usr/local/rvm/scripts/rvm) for my system. It gave a message after typing it in but I hadn't recognised. Which means you were right, something with ruby was not right. So now the webserver finally is up and running :)

Just one more question, how do I stop the mgtt server when it is running? We haven't found a solution other than shutting the whole pc down. And also is there a source for questions like this in your wikis (other than googling, which failed in this case)? So I don't have to ask everytime

RickCarlino commented 6 years ago

@derletztename I'm glad you were able to fix the issue :tada:.

how do I stop the mgtt server when it is running?

To stop the MQTT process you can run:

sudo docker kill farmbot-mqtt

is there a source for questions like this in your wikis

There are a few places:

We are also building an official software developer portal, but it is not ready yet :hourglass_flowing_sand: Please subscribe to the newsletter to be notified when it is published.

dcherrera commented 6 years ago

@derletztename do you have the web server running on your pi usable?

derletztename commented 6 years ago

No, I switched to a x86 system. A small barebone PC with passive cooling

I bought that Zotac x86 PC and installed Ubuntu Server