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.
Related
When I try deploy using capistrano gem I get:
rake stderr: rake aborted!
LoadError: cannot load such file -- nokogiri/nokogiri
In my Gemfile.lock I can see that nokogiri is installed nokogiri (1.11.2-x86_64-darwin) which is for mac since I'm using mac for development, and when I do gem list in my production which is ubuntu I see nokogiri (1.11.2 x86_64-linux).
Based on one of the answers on SO, I removed -x86_64-darwin from nokogiri (1.11.2-x86_64-darwin) but this gave me:
Downloading nokogiri-1.11.2 revealed dependencies not in the API or the lockfile (mini_portile2 (~> 2.5.0)).
Either installing with `--full-index` or running `bundle update nokogiri` should fix the problem.
I ran bundle update nokogiri with no luck and it only said: Bundler attempted to update nokogiri but its version stayed the same.
I know this issue might happen since the nokogiri in my local is for mac and for development is for Linux.
I'm not sure what I can do to resolve this issue. Any feedback is appreciated.
Rails: 6.1.3
Ruby: 2.5.8
I've faced a similar problem and this helped me.
I created a Rails/React app with Webpacker on my Mac running Ruby 2.5.3 and it runs without issue. However when I clone it to my Ubuntu 18.04 machine, I get the below error :
/usr/lib/ruby/2.5.0/yaml.rb:5: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
My Ubuntu machine is also running Ruby 2.5.3, so I'm confused why it references 2.5.0 in the error.
I am able to launch the Rails server with rails s, but when I try to launch the full app with foreman start -f Procfile.dev, I get the error. I've tried reinstalling libyaml and all the Ruby versions on my machine with RVM with no impact on the error. I've also changed my local Ruby version to 2.5.0, and I get a different error message about how my machine is running Ruby 2.5.0 but the project is running 2.5.3.
Procfile.dev file:
rails: bundle exec rails s
webpack: ./bin/webpack-dev-serer
It says the project is running 2.5.0 based on a directive like ruby '~> 2.5' in the Gemfile. Try changing that to the actual version you're running, run bundle to setup Gemfile.lock again, and retry the command.
I had Ruby 2.5.1 installed from ‘sudo apt install Ruby’ and 2.5.3 installed from RVM. I wiped all installed Rubies and RVM, reinstalled 2.5.3 via RVM on the root directory and was good to go.
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.
I am using netBeans with JRuby 1.5.1
I tried to install a gem but I got permission issues.
I solved it by changing user access.
Then I get this error [link] while trying to install gem again.
I installed JRuby 1.7.4 and could manage to install all gems there
Now the problem is when I run the project I get this error:
LoadError: no such file to load -- initializer
require at org/jruby/RubyKernel.java:1054
I'm on Mac OS X 10.6 Snow Leopard. I just updated my Ruby stuff using:
sudo gem update
Unfortunately, it broke everything. When I try to run a simple command in my website directory, like:
rails generate model User
It failed, with this error:
Could not find gem 'rails (= 3.0.3, runtime)' in any of the gem sources listed in your Gemfile.
Try running bundle install.
So I tried running bundle install rails. It succeeded! So I tried running rails. It failed. So I tried getting the Rails version by entering:
rails -v
Which failed with this error:
Could not find rake-0.8.7 in any of the sources
Try running bundle install.
But not only did it fail, it also created an empty folder rails/ruby/1.8 in my website directory.
This is a complete disaster for me as I am just a beginner in Ruby and Ruby on Rails, and even in the Terminal. Any help would be MUCH appreciated. Thanks.
all this stems from having a version of rack that is not exactly 1.0.1 iirc.
Even if you have a version ahead of it, your whole setup will not install properly.
Uninstall all versions of rack and make sure you only have that one.
As Justin said in your comments, now get rvm. Run, don't walk.