When I run cap production deploy I get the following error:
cap production deploy
SSHKit::Command::Failed: ruby exit status: 2
ruby stdout: Nothing written
ruby stderr: Ruby ruby-2.4.0 is not installed
I specified the Ruby version in my deploy.rb file:
set :passenger_restart_with_touch, true
set :rvm_ruby_version, 'ruby-2.4.0'
and included it in my Gemfile:
gem "capistrano", "~> 3.8"
gem 'capistrano-bundler'
gem 'capistrano-rails'
gem 'capistrano-rvm'
gem 'capistrano-passenger'
How should I run Ruby version 2.4.0 on the server without going into the server?
You need to run this on server:
rvm install 2.4.0
Install the Ruby version on the server using
rvm install 2.4.0
and then, in your app's root path, use the installed Ruby:
rvm use 2.4.0
Related
My rails application cannot start because mysql2 load error.
I have tried many solutions, But none can't fix the problem.
Even the rake command can't be executed.
rake aborted!
LoadError: cannot load such file -- mysql2/mysql2
My gemfile is:
ruby '2.5.1'
gem 'rails', '~> 4.2.4'
gem 'mysql2', '~> 0.5.2'
Bundle installed successfully. Mysql installed correctly. Yet the error occurs on MacOS.
Simply, uninstall and reinstall with the following command:
gem install mysql2
If this is not working, you can try adding the following to your mysql_config:
gem install mysql2 -v 0.4.4 -- --with-mysql-config=/usr/local/Cellar/mysql#5.6/5.6.42/bin/mysql_config --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include
I want to install awesome_print in my dockerized ruby application. Running
docker-compose run application_name gem install awesome_print
says "Successfully installed awesome_print-1.8.0," however, it does not appear in my Gemfile even after running
docker-compose run application_name bundle install
How can I install awesome_print in my dockerized application?
The RubyGems gem command is actually a much older package manager that predates bundler.
Running gem install foo just installs the gem to your local repository (a folder somewhere). It does not add the gem to your Gemfile and it does not perform the dependency tree resolution that Bundler does to ensure that your gems are actually compatible.
Bundler is built on top of gem. To install gems with bundler (which is what you pretty much always want to do) you add the gem to your Gemfile and run bundle install.
gem 'awesome_print', '~> 1.8'
Bundler also has a bundle add command which will add a gem to the Gemfile and install your bundle, for example:
bundle add awesome_print --version "~> 1.8"
I am new to ruby on rails and am trying to run my first application which connected to MongoDb. How do i know if I have Mongoid gem installed or if I have to install it? and what is the command to know the gem version.
In my rails application Gemfile I have added:
gem 'mongoid', '~> 5.0.0'
but it gives the error:
usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/resolver.rb:366:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'mongoid (~> 5.0.0.1)' in any of the gem sources listed in your Gemfile or available on this machine. (Bundler::GemNotFound)
I think the gem is not present in your local machine. So it's giving you error. Try running command
bundle install
or you can manually install this gem using console by this command
gem install mongoid -v 5.0.0
Hope it helps. Cheers!
I can't install refile gem from cloned repo on my local.
in my Gemfile:
gem "refile", require: "refile/rails"
gem "refile-mini_magick"
and after running bundle install --without production
i got this error:
Any help?
Check ruby current and default version. rvm list
Make default your ruby 2.2.3 version rvm use 2.2.3 --default
Close terminal and go back to your project directory.
I already have installed this gem: googlecharts.rubyforge.org, but I don't want to require it every time I need it on my actions, so I am trying to do it the Rails way:
config.gem 'mattetti-googlecharts'
Then I go and start my server and get this error:
Missing these required gems:
mattetti-googlecharts
You're running: ruby 1.8.7.174 at
/usr/bin/ruby1.8 rubygems 1.3.5 at
/home/laptop/.gem/ruby/1.8,
/var/lib/gems/1.8
Run rake gems:install to install the
missing gems.
But the gem is installed! I also tried this variant:
config.gem 'mattetti-googlecharts', :lib => 'gcharts'
Use RubyGems repository. The GitHub gem is outdated.
$ gem install googlecharts
Then in your app
config.gem 'googlecharts'
You don't need to require gchart because of this. Also note, you were trying to require gcharts.rb, not gchart.rb.