When I run rails server, 'Could not find jsonapi-parser-0.1.1.beta2' error shows up.
~/ruby_on_rails/test/sampleapp$ rails s
Could not find jsonapi-parser-0.1.1.beta2 in any of the sources
Run `bundle install` to install missing gems.
~/ruby_on_rails/test/sampleapp$ bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Could not find jsonapi-0.1.1.beta4 in any of the sources
bundle update jsonapi
should fix it
jsonapi beta4 is not available. only beta5, beta 1,beta2 are available. you could find this here
Add this line in your gemfile if not and then run bundle install.
gem 'jsonapi-parser', '~> 0.1.1.beta2'
gem 'jsonapi', '~> 0.1.1.beta5'
This might be due to the method which requires jsonparser which is not included in your rails app.
Related
I'm making GitHub blog page with Jekyll. I've failed like numerous times and just forked new one and followed README on the repository.
It's https://github.com/janczizikow/sleek/blob/master/README.md
and I tried to run inside the directory(master) but this msg keeps coming out.
I tried 'gem install bundler' 'gem cleanup' and similar solutions on the internet but still can't fix it. I get that I need another version which is lower one, then how can I remove the current one and install the version I need?
I've never used Ruby so I'm SO lost. A little advice will mean a lot.
bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (~> 1.12) x64-mingw32
Current Bundler version:
bundler (2.0.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
Could not find gem 'bundler (~> 1.12)' in any of the relevant sources:
the local ruby installation
Version 2.0.2 comes from gem install bundler, but the project uses bundler version 1.12.
To fix your issue run
gem install bundler -v 1.12
bundle _1.12_ install
To start Jekyll run jekyll serve or bundle exec jekyll serve.
I am trying to install the gems from my Gemfile to my project, but when I have performed "bundle install", the bundler started installing the default gems, but not that one from my Gemfile.
Gemfile dir: C:\Users\ipinhei5\Desktop\Automation\napps-ANDROIDmation
See below:
[bundle installing default gems]
C:\Users\ipinhei5\Desktop\Automation\napps-ANDROIDmation>bundle install
Fetching gem metadata from https://rubygems.org/............
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using CFPropertyList 3.0.0
Using to_boolean 1.0.2
Using android-adb-extension 0.1.2
Using awesome_print 1.8.0
Using backports 3.13.0
Using builder 3.2.3
Using bundler 2.0.1
Fetching byebug 11.0.1
Installing byebug 11.0.1 with native extensions
[My project Gemfile]:
source "https://rubygems.org"
gem "calabash-cucumber"
gem 'calabash-android'
gem 'cucumber'
gem 'rspec'
gem 'yml_reader'
gem 'rest-client'
gem 'android-adb-extension', '~> 0.1.1'
gem 'pry', '~> 0.10.4'
gem 'pry-byebug', '~> 3.4'
gem 'rubysl-rexml'
gem 'cpf_generator', '~> 1.0'
gem 'meglish', '~> 1.0', '>= 1.0.5'
gem 'pluoa-mapper', '~> 1.0', '>= 1.0.2'
Could you help me how to install the gems from my Gemfile?
Edit 1: I think I misunderstood gems with dependencies.
Edit 2:
I got some errors from installing json package
Fetching json 2.2.0
Installing json 2.2.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.2.0/ext/json/ext/generator
C:/Ruby24-x64/bin/ruby.exe -I C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0 -r
./siteconf20190412-3460-119pn5l.rb extconf.rb
creating Makefile
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.2.0/ext/json/ext/generator
make "DESTDIR=" clean
current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.2.0/ext/json/ext/generator
make "DESTDIR="
make failedNo such file or directory - make "DESTDIR="
Gem files will remain installed in
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/json-2.2.0 for inspection.
Results logged to
C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/json-2.2.0/gem_make.out
An error occurred while installing json (2.2.0), and Bundler cannot continue.
Make sure that gem install json -v '2.2.0' --source 'https://rubygems.org/'
succeeds before bundling.
In Gemfile:
calabash-android was resolved to 0.9.8, which depends on
luffa was resolved to 2.1.0, which depends on
json
It's not installing "default" packages. It is installing the packages in your Gemfile and the dependencies of those packages. If you see that it's installing packages that you didn't specify in your Gemfile, it's because those packages are dependencies of one or more of the packages in your Gemfile.
From the bundle install documentation:
Install the dependencies specified in your Gemfile
...Bundler will fetch all remote sources, resolve dependencies and
install all needed gems.
You can use the gem dependency command with the --reverse-dependencies flag to see why a gem was installed. In your case use, for example, gem dependency CFPropertyList --reverse-dependencies to see why the CFPropertyList gem was installed. At the very bottom of the output of the command it will tell you which package required it as a dependency.
You can also check your Gemfile.lock file after you've run bundle install to see the list of packages you have installed and their dependencies. Under the specs header you'll see a list of all the packages that was installed. Some of the packages have a list of indented packages underneath them. Those are the dependencies of the package.
For example, let's see why the to_boolean package was installed:
specs:
android-adb-extension (0.1.2)
to_boolean (~> 1.0)
You had the android-adb-extension as a dependency in your Gemfile and if we check the android-adb-extension page on rubygems, we see that to_boolean it's (only) run-time dependency.
I've updated a gem version in my Gemfile, so I'm trying to update Gemfile.lock. I run:
$ bundle update
Fetching gem metadata from https://rubygems.org/......
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies.......
Fetching rake 10.5.0
Fetching i18n 0.8.1
Fetching minitest 5.7.0
Fetching thread_safe 0.3.6
....
And get the following error despite it seems to be fetched already (see output above):
Bundler::GemspecError: Could not read gem at /usr/lib/ruby/gems/2.4.0/cache/rake-10.5.0.gem. It may be corrupted.
An error occurred while installing rake (10.5.0), and Bundler cannot continue.
Make sure that `gem install rake -v '10.5.0'` succeeds before bundling.
There's no such file under /usr/lib/ruby/gems/2.4.0/cache/. The cache directory is writable (777).
If I run gem install rake -v '10.5.0' it works fine. But do I really need to install gems manually (error repeats for other packages)? I don't get such errors if just run bundle install without updating gems.
Turned out that setting write permissions on cache directory (/usr/lib/ruby/gems/2.4.0/cache/) is not enough. You have to set write permissions for the parent directory (/usr/lib/ruby/gems/2.4.0/). For some reason, bundle update doesn't write to cache unless you do that even though it doesn't write anything to any other directories on the same level as cache.
I cannot require a custom gem I developed to a ruby project. I use RVM. Here's what I've done:
I added gem locally via Gemfile:
gem 'my-gem', git: 'https://github.com/username/my-gem.git'
I installed the gem:
bundle
Fetching https://github.com/username/my-gem.git
Fetching gem metadata from https://rubygems.org/............
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using my-gem 0.1.0 https://github.com/username/my-gem.git (at master#dcdac02)
Using bundler 1.11.2
Bundle complete! 1 Gemfile dependency, 2 gems now installed.
I confirmed it was installed:
bundle show my-gem
/Users/myuser/.rvm/gems/ruby-2.2.2/bundler/gems/my-gem-dcdac02a8b69
I confirmed my gem paths:
GEM PATHS:
- /Users/myuser/.rvm/gems/ruby-2.2.2
- /Users/myuser/.rvm/gems/ruby-2.2.2#global
When I run gem list, my gem is missing. When I require 'my-gem', the gem cannot be found.
When I run gem which my-gem, I get:
ERROR: Can't find ruby library file or shared library my-gem
I'm not really sure what else to try. Any ideas?
Rubygems have no concept of git installed gems, so Bundler includes a specific mechanism for loading these paths into the GEMPATH, you need to do the following before you can require them:
require 'bundler'
Bundler.setup
See the Bundler git gems docs for more info.
I would make sure the installed version of the gem has all the files you expect, especially lib and its contents. This past discussion might help you:
gem which cannot find gem despite it being installed
I found a similar issue
bundle show kubernetes_metadata_filter
/fluentd/vendor/bundle/ruby/2.3.0/bundler/gems/fluent-plugin-kubernetes_metadata_filter-0cd7e29eacec
while the rest of my gems were install here:
/fluentd/vendor/bundle/ruby/2.3.0/gems/
notice the subtle difference between 2.3.0/bundler/gems/... and 2.3.0/gems/......
HACKY SOLUTION:
after bundle install, i did the following:
gem install specific_install
gem specific_install -l <url to a github gem>
That did the trick and installed the gem to the gems directory, and not just bundler. I beleive the correct fix is the project needs to require bundler on startup, then it will get the bundler installed gems as well, but not all projects are well suited for that solution. good luck!
Recently I have update my rails version to 4.2.3 and ruby version to ruby-2.2.3. After that when I do bundle it gives following error:
$ bundle
Fetching gem metadata from http://rubygems.org/..........
Fetching version metadata from http://rubygems.org/...
Fetching dependency metadata from http://rubygems.org/..
Could not find celluloid-0.16.1 in any of the sources
Could you help me?
Version 0.16.1 of the celluloid gem was yanked and is not available anymore. You will need to downgrade to 0.16.0 or upgrade to 0.17.x. Run:
bundle update celluloid