bcrypt error while deploying rails app to ubuntu server - ruby-on-rails

am getting the following error while deploying my rails app to my ubuntu server
An error occurred while installing bcrypt (3.1.7), and Bundler cannot continue
I have tried gem install bcrypt -v '3.1.7' but that doest seem to work at all
any solution will be highly appreciated

Log files were never created, so there was nothing to show.
Anyway, I restarted my Ubuntu server and suddenly everything worked. Successfully deployed my rails app after restarting Ubuntu server

Related

Nokogiri won't load in production through Bundler

I'm running Ruby 2.2.3p173 on Ubuntu 15.10 with Capistrano for deployment. Deployment went off without a problem and bundled successfully but if I try to open the rails console, I get this with no additional information outside of the backtrace:
Error:
/home/anthony/apps/portal/shared/bundle/ruby/2.2.0/gems/nokogiri-1.6.7/lib/nokogiri.rb:29:in 'require': incompatible library version -`
/home/anthony/apps/portal/shared/bundle/ruby/2.2.0/gems/nokogiri-1.6.7/lib/nokogiri/nokogiri.so (LoadError)`
If I open irb, I can require 'nokogiri' and it works fine, but when I use bundler with Bundler.require, I get the same error.
I've tried uninstalling and reinstalling nokogiri and updating to the newest version. Also went through the advice in the official tutorial here.

Rails installation on hostmonster bundle install fails

So I had a rails app up and working on my hostmonster account just fine. I then updated a few things in my dev environment / pushed them up to github / pulled them back down on my production environment. Now its giving me the error Could not find pg-0.17.1 in any of the sources (Bundler::GemNotFound).
This is a new gem i installed in my dev because i was attempting to move to postgresql for dev and live....for now im using postgresql in dev and mysql2 in production. I know this isn't optimal but im working on it.
I tried running bundle install to get the pg gem installed and it fails with the error
Gem::Exception: Cannot load gem at [/usr/lib64/ruby/gems/1.9.3/cache/rake-10.2.2.gem] in /home4/muscorei/workspace/vollapp
An error occurred while installing rake (10.2.2), and Bundler cannot continue.
Make sure that gem install rake -v '10.2.2' succeeds before bundling.
I try installing rake and it works fine...try again..same error. I have found one question on here that seems to fix this for others but it requires running of gem update --system which you cannot do for hostmonster. Any ideas?
So here is another "related" issue. When i type in gem list --local I see that rails is installed at version 4.1.0....however when i do rails -v it shows the systemwide version of 3.2.13. I don't EVER have any of these annoying issues on my dev environment.

Bundler error when trying to deploy with Capistrano

I am trying to deploy to a remote VPS via Capistrano 3. The VPS tuns on Ubuntu 12.04, Apache, and rvm. When I use cap production deploy on my local computer, it begins to deploy, but then throws a bundler error and quits:
An error occurred while installing minitest (4.7.5), and Bundler cannot continue.
See here for documentation: https://gist.github.com/atkolkma/9551199
gem install minitest -v 4.7.5
Executes successfully. But if I run
gem -v minitest
It says I have version 2.2.2 ! This happens on BOTH machines. Could it be rvm that is doing this? A bundler issue? I have no idea.
UPDATE: I installed RVM, Ruby and Rails as root on the VPS. I am pretty sure this was causing permissions or path problems for Capistrano when trying to bundle my project. I will try to rebuild the VPS with a deployer or rails user. I'll update when I solve this problem.
UPDATE: I installed RVM, Ruby and Rails as root on the VPS. I am pretty sure this was causing permissions or path problems for Capistrano when trying to bundle my project. I will try to rebuild the VPS with a deployer or rails user. I'll update when I solve this problem.

no metadata found in activereocrd-3.2.9.gem when running bundle install in a rails 3.2.9

am a newbie in rails. working on Windows 7, 64 bits. Installed my environment through RailsInstaller. latest version ofcourse.
When creating a new project, (keeping the gem file as default) and having the bundle install run, am getting the error
gem::package::FormatError: no metadata found in
D:/RailsInstaller/Ruby1.9.3/bin/cashe/activereocrd-3.2.9.gem
and error occurrend while installing activerecord (3.2.9), and bubndler cannot continue.
Make sure that gem install activerecord -v '3.2.9' succeeds before building.
I tried to run the gem install activerecord..as instructed still bundle install does not work and i cannot run the rails server. (rails s)
When changing the rails version in the app gem file to 3.2.8 instead of 3.2.9 everything seems to work and the rails server runs succefully. What is wrong?
I uninstalled railsinstaller and all other leftover folders.
reinstalled railsinstaller. Problem solved.

uninitialized constant error in Rails connecting to MySQL after Ubuntu upgrade

I've just upgraded Ubuntu from 11.10 to 12.04 and when I try to run a project locally in Rails 2.3.14 I'm getting this error:
uninitialized constant MysqlCompat::MysqlRes
Is there a way of fixing this easily?
You should re-install the gem you are using to connect to the database.
For example, if you are using mysql2 gem, then you can do:
gem uninstall mysql2
gem install mysql2
This will re-build the native extensions that the Ubuntu upgrade messed up.
While upgrading the gem sometimes get's messed up.
You don't need to uninstall it, just installing again is enough.
gem install mysql2
I've seen this happen with the mysql gem too.

Resources