Ruby On Rails: therubyracer x86-mingw32 missing gems - ruby-on-rails

when I tried to start Server with command rails -s that throw an error:
Could not find gem 'therubyracer x86-mingw32' in any of the gem sources listed i
n your Gemfile.
Run bundle install to install missing gems.
I also try with
gem install
gem update ...
but no effect
my gem file:
gem 'therubyracer', group: :production
I don't know why that can not run! but run with another project is OK.
how can I resolve this?

You can run bundle install --without production to skip that gem being installed for development.

Related

factory_bot_rails failed to install after bundle install

Trying to install the factory_bot_rails gem, but running into this after executing bundle install:
There was an error parsing `Gemfile`: Undefined local variable or method `‘factory_bot_rails’' for Gemfile. Bundler cannot continue.
My rvm is up to date...what exactly is the problem?
Thanks in advance.
I think the problem is how the gem is wrote.
Just type on a console in the project's root directory:
gem install factory_bot_rails
or put inside your Gem file
group :development, :test do
gem 'factory_bot_rails'
end
After type:
bundle install
source: https://github.com/thoughtbot/factory_bot_rails enter link description here

Cannot deploy Heroku

I have referred to several different sources in order to try to push Heroku..
the error code I'm getting is:
An error occurred while installing sqlite3 (1.3.7), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
Failed to install gems via Bundler.
Heroku push rejected, failed to compile Ruby/rails app
I've tried several Gemfile configurations but this is what I currently have:
group :production, :staging do
gem "pg"
end
group :development, :test do
gem "sqlite3-ruby", "~> 1.3.0", :require => "sqlite3"
end
I've also tried different bundles after.. bundle, bundle install, bundle install --without development
I keep getting the same error.
Please help
Thank you
ps: Please note, I'm new with a lot of this.. So please be as specific as possible.
Thanks again
try (on fedora) or equivalent, and then either install this gem alone or restart the bundle.
yum install sqlite-devel

the therubyracer gem keeps causing bundle install to fail on ubuntu 12.04

I'm trying to use capistrano to deploy, and it fails because of a rubyracer gem issue.
I tried adding the following variants to gemfile and then deploying to a production server on ubuntu and nothing works:
1)
gem 'libv8', '3.11.8.3'
3)
gem 'therubyracer'
gem 'libv8', '3.3.10.4'
4)
gem 'libv8', '~> 3.11.8.3'
It all gives the same error:
An error occured while installing therubyracer (0.11.0), and Bundler cannot continue.
Make sure that gem install therubyracer -v '0.11.0' succeeds before bundling.
So I try this instead:
group :production do
gem 'therubyracer', '0.10.2', :platforms => :ruby
end
But that causes this error:
Bundler could not find compatible versions for gem "libv8":
In Gemfile:
therubyracer (= 0.10.2) ruby depends on
libv8 (~> 3.3.10) ruby
libv8 (3.11.8.3)
It seems I currently have two version of lib8 on server:
libv8 (3.11.8.4, 3.3.10.4 x86_64-linux)
Any ideas?
After hours of trying solutions from stackoverflow, I got an easy fix from this site with just 2 commands, the author mentioned that
When installing therubyracer gem you may run into this problem on a
fresh machine install.
http://usefulprogrammingshit.drmcnasty.com/?p=12
sudo apt-get install g++
sudo apt-get install build-essential
I know nothing of ruby so you would need to research more about this solution, but after all, "therubyracer 0.12.2" is installed on ubuntu 14.04. I hope it could help.
Just uninstall both libv8 from your machine
Terminal
gem uninstall libv8
In terminal, You will be prompt to select which version do you want to uninstall like this:
libv8 3.3.10.4 x86_64-linux
libv8 3.11.8.4 x86_64-linux
All
Select 3 and hit enter(return key). It will uninstall your both libv8 versions installed in your machine.
Now, in your Gemfile just include therubyracer without libv8 and bundle install
gem 'therubyracer'
bundle install
It will work
At the command line of the production server do
gem install therubyracer
try node.js as your runtime javascript environment, but not libv8.
if you insist on libv8, don't specify the version. it seems that there's conflicts on the versions. e.g. in your Gemfile:
gem 'therubyracer'
gem 'libv8'

Error message when trying to run the command: bundle install --without production

When I try to run the
bundle install --without production
command on Ubuntu 12.04, I get an error message like this:
Could not find gem 'pg0.12.2 (>= 0) ruby' in the gems available on this machine
Any ideas about why this is happening?
Thanks
If you want 0.12.2 gem to be installed please write in the following way.
gem 'pg', '0.12.2'
If you want version which is greater than 0.12.2 then write in following way
gem 'pg' , '>= 0.12.2'
Please use this link to know more about how to bundle gems in rails Bundle

rails connect to database

I'm trying to open by my rails console in my newsly created app, but I can't connect to a database. It looks like there might be a problem with sqlite3-1.3.3 vs 1.3.4
$ rails c
/Library/Ruby/Gems/1.8/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:71:in `establish_connection': Please install the sqlite3 adapter: `gem install activerecord-sqlite3-adapter` (can't activate sqlite3 (~> 1.3.4, runtime), already activated sqlite3-1.3.3. Make sure all dependencies are added to Gemfile.) (RuntimeError)
Install
$sudo gem install
ERROR: could not find gem activerecord-sqlite3-adapter locally or in a repository
What gems I have installed
$gem list
*** LOCAL GEMS ***
...
sqlite3 (1.3.3)
sqlite3-ruby (1.3.3, 1.3.2, 1.2.5)
I'm using rails 3.1.1
EDIT:
Here is my gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'json'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Running bundle install produces this
$sudo bundle install
using rake (0.9.2.2)
...
Using sqlite3 (1.3.3)
Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed.
$ bundle show sqlite3
/Library/Ruby/Gems/1.8/gems/sqlite3-1.3.3
You're using Rails 3.1, which uses bundler to manage gems.
Add gem 'sqlite3' to your Gemfile
run bundle form the command line
This will install the gems your app needs. You should then be able to launch the console.
I've seen similar situations in the past because of missing/bad shared libraries. Gems install ruby code, native bindings to libraries, but they do not install the external libraries themselves.
The dependency for sqlite on Ubuntu, for example, is libsqlite3-dev.
$ sudo apt-get install libsqlite3-dev
For OSX:
Install sqlite3 on mac osx?

Resources