Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rubygems not working on Synology DS209

I'm trying to install Ruby on Rails on my Synology DS209 using the instructions at http://wiki.joachimschuster.de/index.php/Install_Ruby_on_Rails_and_Redmine_on_DS210%2B. I have all the prerequirements checked (except for the redmine-user, which I assume isn't the problem), and the rubygems and zlib packages installs just fine through ipkg.

However, when i run gem, I get the following errors:

DiskStation> gem
/opt/bin/gem: line 8: require: not found
/opt/bin/gem: line 9: require: not found
/opt/bin/gem: line 10: require: not found
/opt/bin/gem: line 12: required_version: not found
/opt/bin/gem: line 14: unless: not found
/opt/bin/gem: line 15: abort: not found
/opt/bin/gem: line 16: end: not found
/opt/bin/gem: line 21: syntax error: unexpected "("
DiskStation>

Any suggestions?

EDIT: Removing and reinstalling rubygems revealed the following:

DiskStation> ipkg remove -force-removal-of-dependent-packages ruby
Removing package rubygems from root...
Removing package ruby from root...
Successfully terminated.
DiskStation> ipkg install rubygems
Installing rubygems (1.1.1-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/rubygems_1.1.1-1_arm.ipk
Installing ruby (1.9.1.243-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/ruby_1.9.1.243-1_arm.ipk
Configuring apache
update-alternatives: Linking //opt/sbin/htpasswd to /opt/sbin/apache-htpasswd
update-alternatives: Linking //opt/sbin/httpd to /opt/sbin/apache-httpd
httpd: Syntax error on line 75 of /opt/etc/apache2/httpd.conf: Cannot load     /opt/libexec/mod_ext_filter.so into server: /opt/libexec/mod_ext_filter.so: undefined symbol: apr_procattr_limit_set
httpd: Syntax error on line 75 of /opt/etc/apache2/httpd.conf: Cannot load /opt/libexec/mod_ext_filter.so into server: /opt/libexec/mod_ext_filter.so: undefined symbol: apr_procattr_limit_set
postinst script returned status 1
ERROR: apache.postinst returned 1
Configuring ruby
Configuring rubygems
Successfully terminated.
like image 637
blomkaal Avatar asked Feb 21 '23 00:02

blomkaal


2 Answers

I have the same problem..

gem is a script file and if you see inside, it calls ruby like this "#!/opt/bin/ruby". Let's see "/opt/bin/ruby"!! it is also a script file which calls "#!/opt/bin/ruby".

It's non-sense...

I think that there is a bug installing packages.. Up to now, I have no solution...

I found solution... Install ruby again.

ipkg install ruby -force-reinstall

after this, you have binary ruby file.

If you trying redmine on DSM 4.0, installing rails require libcrypto.so.0.9.8 which is not in your NAS. Make a copy with /usr/lib/libcrypto.so.1.0.0 and you would make it.

like image 196
Jeffrey Avatar answered Feb 23 '23 13:02

Jeffrey


Thanks for all the answers, it was enough for Ruby, but I had to do a bit more to get rails 2.3.5 installed (I also wanted to get Redmine on my DS209+; I'm glad to report that's working for me).

I tried this (from this web site: http://ash-ride.blogspot.ca/2010/09/redmine.html) gem install rails -v 2.3.5

But all I got was:

ERROR:  Error installing rails:
        rake requires RubyGems version >= 1.3.2

So here's how I got around and installed rails:

  1. gem install rack -v 1.0.1
  2. wget http://rubyforge.org/frs/download.php/55066/rubygems-1.3.2.tgz
  3. tar xvzf rubygems-1.3.2.tgz
  4. cd rubygems-1.3.2
  5. ruby setup.rb
  6. gem install rails -v 2.3.5

And bingo, working copy of rails with DSM 4.0-2198 on a DS209+. Not sure if I had to install rack first, but hey, it's working! Last steps for Redmine are to install the MySQL connector and download RedMine (see blogspot reference).

Thanks for the trick on libcrypto.so.0.9.8. I had to do the same thing on copying libssl.so.1.0.0 to libssl.so.0.9.8 (required for the database script).

like image 45
Mathieu Dugré Avatar answered Feb 23 '23 13:02

Mathieu Dugré