I'm using RVM on my development machine for my Ruby on Rails application which works really well. My question is should I (can I) use RVM on my live server for deployment?
I already have the web app up on a live server using Passenger but I have just installed Ruby and all the gems on the system.
Are there any performance issues with RVM and is there much that I would need to do with my Apache web server to get it up and running?
Thanks
Performance of ruby compiled manually and with RVM - should be the same (unless you uses patches like patchexpress or falcon).
You can use RVM for deployment - you can do it together with updating ruby version / patchlevel, it's very important to use the latest patchlevel as it contains important fixes for ruby - including security fixes.
As for integration of RVM compiled Rubies - read the docs: https://rvm.io/integration/passenger/
Related
I have almost finished my first Ruby on Rails application, i have used Ruby 2.1.2 and Rails 4.2.4.. then i want to deploy it, the hosting i took gave me 1month trial but they have installed CPanel 11 (it has rails 2.3.18 by default)
but when i try to install the rails 4.2.4 gem it gives me this:
> Error installing rails: i18n requires Ruby version >= 1.9.3.
My questions are:
Is there a way to update the ruby?
Would i have any trouble if they just update to 1.9.3 when i have used 2.1.2?
this is a screenshot from the gems in the cpanel
Recently I had to upgrade my Ruby version to a higher one and I was in a very similar situation like yours.
I used rvm for this.
Use rvm for listing the ruby version with the following command:
rvm list known
Then upgrade ruby with: rvm install version_of_your_choice
Also, search the internet for tutorials. StackOverflow has all the answers.
I used RailsInstaller (for Windows) to set up my environment for my Rails 3 app. I recently installed Pik so that I can update my ruby version as well.
According to the Pik docs https://github.com/vertiginous/pik/wiki/Usage, running 'pik install ruby 1.9.3' should install lastest version of ruby (or atleast the latest patch level for the version I am specifying).
However, this only installs ruby 1.9.3p429, but I understand that 1.9.3p545 is available.
Does anyone know how I can install 1.9.3p545?
Thanks!
Looks like you went with Pik from your previous question. I read on another thread that Pik only supports some of the 1.9.3 patch levels, but unfortunately nothing verifiable. The project has also been abandoned, no longer maintained, which might explain why that latest patch isn't supported...
Might just be my perspective, but seems like Windows is very poorly supported in the Rails/Ruby world? Our project requires Windows and Linux support which is causing us lots of grief. If you find a solid & reliable upgrade solution for Windows I would be very interested!
I am on ubuntu 12.04.1 LTS.
I have installed apache2 running as www-data.
I want to use ruby 1.9.3.
I need to install passanger.
The question is which installation method should I use to install rvm. Should I use the single-user or the multi-user installation.
If I have to use the single-user installation, do I install it as my user or as www-data.
On my production systems, I install RVM system-wide. That way I can log in (or anyone else can login) and pull up a console on the system using the same ruby and gemsets. I am sure there are ways to do that with single user, but this has always been the least complicated for me.
However, for Passenger, I recommend installing that against the system ruby. The reason for that is because every time you change or upgrade your ruby, it would blow up your passenger installation and you would need to change your Apache configuration and rerun the passenger installation. This works because passenger and your application do not need to run on the same ruby installation.
I have a rails application that I am trying to deploy onto the internet. I have setup a server on the Amazon EC2 cloud, that I know works because I have deployed another site to the same machine.
When I try to run this new application either through 'rails console' or when running 'rake db:seed' or just by trying to browse to the application, rails crashes saying it cannot find activiesupport:
/home/ec2-user/.gem/ruby/1.9.1/gems/activesupport-3.2.2/lib/active_support/core_ext/big_decimal/conversions.rb:1:in `require': cannot load such file -- bigdecimal (LoadError)
My Rails version is 3.2.2 and I'm using ruby 1.9.3p0 (2011-10-30) [x86_64-linux]. My database is MongoDB which I access through Mongoid. And I'm using Passenger and Apache as a server.
Is there any configuration step or something like that that I have missed?
P.S. I know I shouldn't be using ec2-user, I'm still experimenting. And also, I've never had much luck with RVM.
I encountered the same problem with Rails 3.2.3 and Ruby 1.9.3p0 on my Amazon EC2 instance, where Ruby had been installed with the ruby19 yum package. In my case, the problem seemed to be that I had installed the bigdecimal gem manually using the gem command instead of using Bundler. To fix the problem, I uninstalled the gem manually, added the line
gem 'bigdecimal'
to my application's Gemfile, and re-ran bundle install. This reinstalled the gem and then my application was able to load it successfully.
My gems are also installed in ~/.gem/ruby/1.9.1/, even though I am running Ruby 1.9.3p0. This does not appear to be a problem.
I've tried to start the rails server with this line:
$ rails s
create
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
...
create log/test.log
But if I write down this:
$ script/rails s
/usr/lib/ruby/gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:138: warning: Insecure world writable dir /usr/lib/ruby/gems/1.8 in PATH, mode 040777
=> Booting WEBrick
=> Rails 3.0.1 application starting in development on http://0.0.0.0:3000
...
Anyone can see the problem? I think is a problem with environment variables, but I don't know how to fix it.
Thanks
I just came across this problem. I was switching from a Windows environment to Linux. My Linux version of rails is 2.3.14 while my Windows version was 3.0.1. On Windows "rails s" or "rails server" worked as expected to start a server, but on Linux it just created new projects with the names "s" and "Server" respectively. What finally explained it is the answer to the question below. Apparently the command behavior was changed between rails versions.
rails script/server doesn't start the server
The best solution is probably to update to the latest rails.
I was able to do that on my linux box by following the instructions below and using "sudo gem install rails"
http://installfest.railsbridge.org/installfest/ubuntu
http://root2linux.com/2011/01/install-rails-3-on-linux-mint-10/
this issue come from the different version in rvm, I faced this issue when my app was created using rvm 1.9.2 and I tried to run the server while rvm 1.9.3 was the running rvm version, simply switch to rvm1.9.2 and all will work properly (rvm use 1.9.2) in the terminal in ubunutu
Are you in a rails application directory? When you're running rails s make sure you've cd'd into the correct Rails directory. Common problem :)