ImageMagick conflict on Ubuntu running webbrick - ruby-on-rails

I am trying to install refinerycms, a Ruby on Rails CMS on Ubuntu 10.04 LTS. I run rails server and I get the following exception:
carcher#carcher-laptop:~/Code/tgc$ rails server
=> Booting WEBrick
=> Rails 3.0.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick2.so: This installation of RMagick was configured with ImageMagick 6.6.4 but ImageMagick 6.5.7-8 is in use. (RuntimeError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/rmagick-2.12.2/lib/RMagick.rb:11
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/analysis/r_magick_analyser.rb:1
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/config/r_magick.rb:15:in `apply_configuration'
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/configurable.rb:33:in `configure'
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/config/r_magick.rb:14:in `apply_configuration'
from /usr/lib/ruby/gems/1.8/gems/dragonfly-0.7.6/lib/dragonfly/configurable.rb:39:in `configure_with'
from /usr/lib/ruby/gems/1.8/gems/refinerycms-0.9.8.2/vendor/refinerycms/images/lib/images.rb:10
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `instance_exec'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:25:in `run'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:50:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/initializable.rb:49:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:134:in `initialize!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in `send'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.0/lib/rails/application.rb:77:in `method_missing'
from /home/carcher/Code/tgc/config/environment.rb:5
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:591:in `new_constants_in'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:225:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
from /home/carcher/Code/tgc/config.ru:3
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /home/carcher/Code/tgc/config.ru:1:in `new'
from /home/carcher/Code/tgc/config.ru:1
carcher#carcher-laptop:~/Code/tgc$
I built and installed ImageMagick 6.6.4 from source following the instructions here and BEFORE I did that I removed the ImageMagick tools that were pre-installed in Ubuntu, to avoid any conflicts. But still I seem to have this version 6.5.7 around.
I guess my question is how do I remove/disable ImageMagick 6.5.7-8?
Thanks in advance for the help, I'm all out of ideas.
Cheers, Ciaran.

Lots of help at the Refinery Google group: http://groups.google.com/group/refinery-cms. Or have you tried that already?

I'm up and running! I did a clean Ubuntu install, and just used the pre-installed Imagemagick package. The Refinery CMS tutorial for Lunix omits a few things a novice like me needs to do, so I documented all my steps here.
The main problem was that early in the process when I ran into an issue with RMagick, I presumed I needed a later version of Imagemagick so I downloaded and installed it from source. There is no need to do that - none at all. The version 6.5.7-8 will do just fine and play well with RMagick and with RefineryCMS.
Hope this helps others.
If you need to use the latest version then I found this post that might help. I haven't tried it though:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557778
I posted this info on the RefineryCMS Google message board too.
Cheers,
Ciaran

Related

Ruby1.8 Rails2.3 ./script/server producing error

I have been assigned a projected that was written in Ruby1.8 and Rails2.3. We can't upgrade at the moment. I have successfully installed ruby and rails and installed all needed gems for the project on a ubuntu machine. I have received success messages while installing everything.
However, when I run the command ./script/server I received the output:
/var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require': no such file to load -- sentry (MissingSourceFile)
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /home/robotmaster/Documents/Source/agile/config/initializers/sentry.rb:1
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load_without_new_constant_marking'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:171:in `load'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:622:in `load_application_initializers'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:621:in `each'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:621:in `load_application_initializers'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:176:in `process'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:113:in `send'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/initializer.rb:113:in `run'
from /home/robotmaster/Documents/Source/agile/config/environment.rb:42
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.18/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/rails-2.3.18/lib/commands/server.rb:84
from ./script/server:4:in `require'
from ./script/server:4
I am new to the Rails and would appreciate any help with this error message. Thanks
The key to the issue is here:
sentry (MissingSourceFile)
I'm really not familiar with that particular file (and Rail 2.3 is several major revisions behind...) but it indicates to me that there's something incomplete about your Gem set.
gem update
This would be my first attempt. Verify that all of the referenced gems in your Gemfile are present on the system. If at all possible, I'd really look to upgrade to at least Rail 3, preferably 4.
EDIT:
Reading this again, why are you executing ./script/server? You should be executing:
rails s

When I try the command rails server on a new project I get this error

I am running Debian 7. I am using RVM. I am also running mySQL. I am new to ruby in general as well as rails. Please excuse any of me if I seem naive at all.
I setup a project with:
rails new projectname -d mysql
Then I went into that directory and ran:
rails server
I then get this error:
/home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs.rb:5:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/execjs-2.0.0/lib/execjs.rb:4:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/user/htdocs/simple_cms/config/application.rb:7:in `'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in '
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap'
from /home/user/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.14/lib/rails/commands.rb:50:in `'
from script/rails:6:in `require'
from script/rails:6:in `'
I went to the link that was provided: https://github.com/sstephenson/execjs
The Read Me under Install says:
gem install execjs
I do this and still get the same error. I am lost.
You have to first install a Javascript runtime, such as Node.js.
For Debian, there's installation instructions on Node.js Github
Edit: The ExecJS README lists the supported Javascript runtimes.
I did install therubyracer. I put the necessary gems insides the projects gem file. This seems to have solved this issue.

javascript runtime error with `rails s` command on remote server

I just set up a VPS to prepare for launching a Rails app and, on the actual remote server, I created a new rails project to test things out, only doing rails new blog -d postgresql. I then tried to start the server using the rails s command and got the error below.
.rvm/gems/ruby-1.9.3-p429#anwalt/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /home/michael/.rvm/gems/ruby-1.9.3-p429#anwalt/gems/execjs-1.4.0/lib/execjs.rb:5:in `<module:ExecJS>'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#anwalt/gems/execjs-1.4.0/lib/execjs.rb:4:in `<top (required)>'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#anwalt/gems/uglifier-2.1.1/lib/uglifier.rb:3:in `require'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#anwalt/gems/uglifier-2.1.1/lib/uglifier.rb:3:in `<top (required)>'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#global/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from /home/michael/blogy/config/application.rb:7:in `<top (required)>'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#anwalt/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `require'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#anwalt/gems/railties-4.0.0.rc1/lib/rails/commands.rb:78:in `block in <top (required)>'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#anwalt/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `tap'
from /home/michael/.rvm/gems/ruby-1.9.3-p429#anwalt/gems/railties-4.0.0.rc1/lib/rails/commands.rb:75:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I installed $ gem install execjs but still get the same error (I think I have to require it somewhere). Anyways, my question is, why wouldn't the rails s command work on a VPS out of the box the way that it works on a local machine, and, if not using rails s command how am I supposed to start the application once I do launch my real app (rather than this dummy app).
Try to install node.js via apt-get install nodejs or sudo apt-get install nodejs if you are using debian\ubuntu.

Does TinyTDS support Ruby 2.0.0?

I am having real trouble trying to get TinyTDS working with Ruby 2.0.0 on Windows 7.
When i run a rails c (or require tiny_tds from an irb), i get the following:
D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- tiny_tds/tiny_tds (LoadError)
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds.rb:16:in `rescue in <top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/tiny_tds-0.5.1-x86-mingw32/lib/tiny_tds.rb:12:in `<top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `block in require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
from S:/code/user/app/ruby2_test/config/application.rb:7:in `<top (required)>'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:39:in `require'
from D:/Ruby/Ruby200/lib/ruby/gems/2.0.0/gems/railties-3.2.13/lib/rails/commands.rb:39:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have tried installing the latest version of the gem:
gem install tiny_tds --pre
And looking inside:
D:\Ruby\Ruby200\lib\ruby\gems\2.0.0\gems\tiny_tds-0.6.0.rc1-x86-mingw32\lib\tiny_tds
I can see there is no 2.0 directory, which leads me to believe version 2.0 isn't supported. However i can see no mention on the TinyTDS github or any other sites about this issue.
So, am i missing something or does TinyTDS currently just not work with Ruby 2.0?
Copying the answer from the comments in order to remove this question from the "Unanswered" filter:
I believe this is an issue with OS that you are using as another
individual had the same issue. As stated I believe this is a
dependency issue with Windows. Please see the comment from MetaSkills
- https://github.com/rails-sqlserver/tiny_tds/issues/110#issuecomment-15503928
~ answer per David

Cannot Install Intercom.io gem Ubuntu 12.04 LTS

I'm trying to install intercom.io into my rails app, however I get this when generating the config file:
/var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails/config.rb:13:in `send': undefined method `define_singleton_method' for IntercomRails::Config:Class (NoMethodError)
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails/config.rb:13:in `config_reader'
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails/config.rb:8:in `config_accessor'
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails/config.rb:74
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails.rb:9:in `require'
from /var/lib/gems/1.8/gems/intercom-rails-0.2.14/lib/intercom-rails.rb:9
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:68:in `require'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `each'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:66:in `require'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `each'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:55:in `require'
from /var/lib/gems/1.8/gems/bundler-1.2.3/lib/bundler.rb:128:in `require'
from /home/ian/SB/config/application.rb:7
from /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/commands.rb:24:in `require'
from /var/lib/gems/1.8/gems/railties-3.2.11/lib/rails/commands.rb:24
from script/rails:6:in `require'
from script/rails:6
It looks like you're on ruby 1.8, and our gem currently uses a ruby 1.9 feature Object#define_singleton_method
We've created an issue on the intercom/intercom-rails github repo to track fixing this. I'll let you know when there's a new version.
If possible, it's recommended to run rails 3+ on ruby >= 1.9.3 (which for us at least mean't installing from source).
Thanks for bringing this to our attention.

Resources