Ruby on Rails Thursday, August 29, 2013

Dear all,
I am developing a web harvesting server which requires regularly
website parsing. Since I use Mac 10.8 as my development environment, I
try to use Launchd to routinely wake up my parser. My parser was a bash
script which has only two lines:
1. cd $HOME/ProjectFolder
2. bundle exec rake dailyTask:dataParse

When directly execute the script under Terminal, there is no
problem. However, when this script is called by Launchctl, it produces
errors, which looks like:

/usr/local/Cellar/ruby/2.0.0-p195/bin/bundle exec rake
dailyTask:dataParse --trace >> /tmp/cron-test.out
/usr/local/Cellar/ruby/2.0.0-p195/lib/ruby/gems/2.0.0/gems/mysql2-0.3.13/lib/mysql2/mysql2.bundle:
[BUG] Segmentation fault
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

I look around for segmentation fault problem. Most posts suggests
RVM or rbenv to swap Ruby version. None of the posts looks relevant to
me since I can directly execute under terminal environment.

OS: MAC OSX 10.8.4
Ruby version: 2.0.0p195
Bundler version: 1.3.5
Rake version: 10.0.4

The relevant part of my plist file is as following:
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>crontab-test.sh</string>
</array>

Hope someone can give me the right direction to continue. Many
thanks!

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e22178a3c94bbc3fee8af29169a8ea0f%40ruby-forum.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment