Connect Ruby on Rails Application to an ESB - ruby-on-rails

I want to connect a ruby on rails application with to an ESB. Is it possible to connect a Ruby application with an ESB?
Please provide explanations and suggestions.

Yes.
Please notice that Ruby is soft-typed and that EBS services should (normally) be strong typed, so that you will probably require manual type checking.
Ruby could probably be used for most applications (not system writing) and it definitely fits well within a Service oriented design such as an EBS.

Related

Hosting for Ruby (and Rails) like hosting for PHP

I was wondering if there was around a hosting as those that have existed for years for PHP that would give the opportunity to publish many Ruby and Rails applications and not as Heroku that forces a single application for dyno.
In classical hosting PHP I can create a folder, upload some files in php and navigate them through links.
You can something like that on some Web hosting?
For small projects, Heroku is really the best deal. Their free tier does everything you'd need for something that's occasionally used and doesn't have a lot of scaling issues. You are restricted to one application per "dyno", per account.
For anything more demanding it's not hard to set up a hosting environment on a VPS provider. Although it takes some additional knowledge, you'll be able to set up and configure a web server using a tool like Passenger and manage your own instances. For $10/mo. you can have a very capable server instance that will handle way more than a $7/mo. dyno can manage. Even the $5/mo. server from a provider like Digital Ocean is a fantastic deal.
PHP's fire and forget method of hosting is convenient, but it's actually a lot more work in the long haul compared to an efficient workflow based around Rails and Passenger.
For example, using Capistrano and a version control system like Git you can make changes, test locally, package up into a commit and deploy on your server within minutes. It's basically effortless once you get it working.
For small production projects, I use webfaction, it's easier to push to production than to configure a complete VPS as it's more like a managed hosting (with all the tools and documentation you need for rails) .
I use mina for deployment and Git for version control.
To complete #Tadman answer you can check OpenShift if you want a more Heroku like alternative.
When I started using Rails I was also tempted to compare and seek for a 'php-hosting' like solution. But it's just a different approach.
To answer your question more precisely, you don't drop files in a folder and navigate with links in a classic rails project. You have to understand the concept of MVC, routing ...
I suggest that you give the rails-tutorial a try, it is a good starting point for understanding the whole rails ecosystem.
You can try Ruby hosting on Jelastic PaaS with automated deployment to containers and scaling, as well as pay-per-use pricing model that makes it not so pricy.
There are pre-configured Apache and NGINX containers for running Ruby application, supported different Ruby versions, built-in Ruby on Rails framework, Passenger, Puma, Unicorn, Bundler dependency manager etc.
When deploying a Ruby application, only a single context (ROOT) can be used. However, you can switch between three deployment types: deployment, production and test.
More details are described here https://jelastic.com/blog/ruby-paas-hosting/
You can start with a free trial and test how it suits your project before investing any budget. This Ruby PaaS is available on different local service providers https://jelastic.cloud/

Problems with Rails on Namecheap server

O. Community, and thanks in advance for the support!
I recently took Mattan Griffel's One Month Rails course on skillshare to be able to write rails web apps.
Railsinstaller.org includes rails 3.2.1 and ruby 1.9.3 and works perfectly out of the box.
My app worked well and it was time to get it up on the web, so I purchased a namecheap domain and webserver, uploaded my app and... nothing!
The problem is that the namecheap servers only support rails 2.3.17 and ruby 1.8.7 - nothing created with v 3.x or dependent on ruby 1.9.x will run in a 2.x / 1.8.x environment.
Has anyone else run into this issue?
It seems like such a standard use case, I can't believe it's not better documented on the namecheap site.
I've done my Google-Fu and have learned that, once I installed it, I could create an older rails app using
rails _2.3.17_ AppName
Is there a similar way of forcing rails to use an older version of ruby as well?
I'm close to cancelling my namecheap account altogether in disgust, so if someone out there knows of a better place to host my rails 3.x web apps, I'd love to hear about it!
(Let's assume, for the time being, that a VPS is prohibitively expensive and far in excess of what I need, resource-wise).
Thanks again,
One Frustrated User
You can use heroku free account to begin with. Don't waste time on fixing problems on shared hostings, they are just toys.
Rails 3.x native cPanel support is still unreleased , feature request case is still open
http://forums.cpanel.net/f145/mod_rails-passenger-instead-mongrel-rails-3-support-case-44197-a-152577.html
This is tricky but possible to run Ruby 3 applications - additional software installation and global server reconfiguration required in this case, but hardly possible on regular shared server per user. We can offer to upgrade your hosting account to VPS. All your existing account content including databases, additional domains, email accounts and settings will be transferred transparently to VPS. To optimize your VPS with cPanel and make possible for you to develop and run Ruby 3 application you may request our technical support team to tune up the system according to all your requirements. Operating system tuning and custom software installation is included with Full Management VPS option. You may request part-time technical support as an alternative.
Regards,
Dima S.
Technical Support,
Namecheap Hosting

Custom command line options rails 3 Ruby

I am working on a website project that requires ruby 1.8.7 and using am currently rails 3.2. This is a research project and thus maybe a bit "unconventional".
I have a rails server, the manager, that spawns other rails servers which become peers in a P2P network.
I want to pass custom options to my spawned servers to configure them. I thought about doing something like this but it does not seem possible in rails. Does somebody have a suggestion of how to do something similar?
rails server --custom_option="CUSTOM_VALUE"
Will environment variables work?
CUSTOM_OPTION=CUSTOM_VALUE rails s
This should give you access to it:
`$CUSTOM_OPTION`

Sentry Rails Client

per the Sentry documentation:
...Sentry is not limited to Python. The primary implementation is in Python, but it contains a full API for sending events from any language, in any application.
There is a gem called 'sentry' however it is a encryption library having to with OpenSSH and totally unrelated.
Is there a Rails Client for hooking to Sentry already or some other comparable technology out there which can be used with Rails?
If not, +1 for a Rails Sentry Client
As I write this (last updated May 2015), the Sentry docs list clients for Java, JavaScript, Node.js, PHP, Python, and Ruby.
It is a bit hidden, but in the hosted version (dont know if its in the open source version too) you can find information about Ruby and RoR integration on this page:
https://app.getsentry.com/account/projects/PROJEKCT-SLUG/docs/
So it looks like they have Ruby support, but dont tell us on there webpage.
EDIT: I found this: https://github.com/coderanger/raven-ruby
When logged in, there is a reference to https://github.com/coderanger/raven-ruby in the docs.

Writing ruby web-service. What architecture should I use? Rack, Rails-engine?

I need to write web-service that will get files over http and convert them. This service in future might be included in rails application. I wonder what I need to use for that?
Mount as Rack-middleware? Sinatra app? Write Rails-engine? Simple ruby script with networking? Anything else?
Thanks
If you may eventually incorporate it in a rails app, then I would use rails to get the service up and running. The framework provided by rails makes creating web services very easy (sometimes with as little as a line or two of code).

Resources