2

I'm very new to Ruby on Rails and build a small DemoApp with it. This App collects some network data and stores it in a database. This task is done by whenever every minute. I developed and tested this on Ubuntu and it worked perfectly fine.

Now, i want to deploy this app to my Raspberry Pi. I installed rvm, ruby, rails etc. on it and started the rails server. Strangely the background job of collecting and storing the network data didn't seem to work. So i executed it by myself and got this:

script/rails runner -e development 'LogEntry.updateRecords'
/home/user/.rvm/gems/ruby1.9.3-p374/gems/sqlite3-1.3.7/lib/sqlite3/sqlite3_native.so: [BUG] Segmentation fault
ruby 1.8.7 (2012-02-08 patchlevel 358) [arm-linux-eabihf]

When I'm using "rails console" LogEntry.update works perfectly fine again.

schedule.rb:

every 1.minute do
runner "LogEntry.updateRecords", :environment => :development
end

resulted crontab entry:

# Begin Whenever generated tasks for: store
PATH=/home/user/.rvm/gems/ruby-1.9.3-p374/bin:/home/user/.rvm/gems/ruby-1.9.3-p374@global/bin:/home/user/.rvm/rubies/ruby-1.9.3-p374/bin:/home/user/.rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games

* * * * * /bin/bash -l -c 'cd /home/user/WhoIsOnline/AWE13-Exercise-1 && script/rails runner -e development '\''LogEntry.updateRecords'\'''

# End Whenever generated tasks for: store

ruby -v

ruby 1.9.3p194 (2012-04-20 revision 35410) [arm-linux-eabihf]

After lots of different rvm settings and google searches, I hope you guys can help me.

StateOfTheArt89
  • 138
  • 1
  • 10
  • Works for me now if I use "rails runner -e development" instead of "script/rails runner -e development" in crontab. But I have no idea why. – StateOfTheArt89 Feb 05 '13 at 16:19

0 Answers0