I was using the rails server this Am. Now i try to run my server on mac and I get:
Could not find json-1.8.2 in any of the sources
Run `bundle install` to install missing gems.
So i run bundle install and I get...
Fetching source index from https://rubygems.org/
Using rake (10.4.2)
Using CFPropertyList (2.3.1)
Using i18n (0.7.0)
Errno::EACCES: Permission denied - /Users/danielhatcher/.rvm/gems/ruby-2.0.0-p247/gems/json-1.8.2/tests/test_json.rb
An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling.
so i try running gem install json -v '1.8.2' and get this...
ERROR: Could not find a valid gem 'json' (= 1.8.2) in any repository
any help would be greatly appreciated. I can't find anything out on the net about this.
ruby 2.0.0p247
Are you just getting your workspace setup?
I had the same problems before when I was getting started.
I went to railsinstaller.org and development environment has been working well since then.
Hope this helps.
If I had to take a guess at this issue, I would say you opened a new shell since the AM and your new shell isn't configured to use the version of Ruby you installed with RVM.
I would take a look at this, https://rvm.io/rvm/basics
And basically make sure your using the version of Ruby that you installed with RVM, and that your shell is configured to use it.
And the latest version of the JSON gem appears to be 1.8.3 so you might want to try that version. https://rubygems.org/gems/json
I hope my comments help you out.
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.
In command prompt I run
rails server
and it gives me the error: "could not find nokogiri -1.10.0 in any of the sources"
I then go to install the gem:
gem install nokogiri -v 1.10.0
and git gives me the error: "The last version of nokogiri (=1.10.0) to support your Ruby & RubyGems was 1.10.0. nokogiri requires Ruby version >= 2.3, < 2.7.dev. The current version is 2.7.2.137
How do I get around this issue?
Also, I'm sure I'm going to run into a similar problem again every time I try to run
rails server
It keeps telling me there is a missing gem which tells me me there is something wrong with the install. I have uninstalled and reinstalled Ruby multiple times but the issue doesn't get resolved. Help with my first question would be great but help with my overarching issue would be even more appreciated.
Thanks,
The version of Nokogiri you try to install is not compatible with the latest version of Ruby. You have two options:
Downgrade Ruby to <= 2.6.6 or
Upgrade Nokogiri to >= 1.10.4
It depends on your application which option to choose.
I would prefer upgrading Nokogiri to the latest version. To do so change the version of Nokogiri in your Gemfile to 1.10.10 and run
$ gem install nokogiri -v 1.10.10
$ bundle update nokogiri
I have Ruby 2.2.6 and Rails 5.0 installed succesfully, however I don't seem to be able to install gems. Here's the error I get:
Errno::EACCES: Permission denied # rb_sysopen -
C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/nokogiri-1.7.1-x86- mingw32/lib/nokogiri/2.3/nokogiri.so
An error occurred while installing nokogiri (1.7.1), and Bundler cannot
continue.
Make sure that `gem install nokogiri -v '1.7.1'` succeeds before bundling.
I searched for solutions but all the suggestions are for Unix commands.
I'm on Windows so I'm not sure how to enable permissions in order for this install to pass succesfully.
Any (ELI5 level) suggestions for me?
Have you tried executing:
gem install nokogiri -v '1.7.1'
In your command line?
If you are still getting an error, post the error message.
If you go to the Nokogiri website, you'll find special instructions for installing it on Windows.
A number of Ruby libraries are called native libraries, meaning they're written in C for Unix, and so require Unix build tools to make.
I'm loosing my mind trying to figure out how to solve this issue. I don't know anything about Ruby, I'm just trying to read the docs of react which needs Jekyll to serve them as they're markdowns (didn't understand why they need to complicate things like that). The readme file of the docs says that you have to install these:
Ruby (version >= 1.8.7)
RubyGems (version >= 1.3.7)
Bundler
which I've done. And then you'll have to do these instructions:
cd react/docs
bundle exec rake
bundle exec jekyll serve -w
open http://localhost:4000/react/index.html
But when I execute the second command bundle exec rake, this stupid error is thrown:
Could not find gem 'wdm (>= 0.1.0) x86-mingw32' in any of the gem sources listed in your Gemfile.
Run bundle install to install missing gems.
I run bundle install and it throw an error too:
An error occurred while installing json (2.0.1), and Bundler cannot continue.
Make sure that gem install json -v '2.0.1' succeeds before bundling.
I try to install gem install json -v '2.0.1' and it throws an error:
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
What the hell is going on? Why don't they make something simple? This should be easy not as complicated as rocket science!
Note: I'm using Windows 32bit if that is of some importance.
Any help is very appreciated!
You have to install the DevKit. Learn how here!
Then make sure bundle is installed or install it like this:
gem install bundle
Note: this is my first attempt with Ruby and Rails!
Once I've installed everything I tried to create a new app with
rails new rubyapp
the command created everything and then the bundler started. While running it stopped at
Errno::EACCES: Permission denied - /Library/Ruby/Gems/1.8/build_info/coffee-script-source-1.6.2.info
An error occurred while installing coffee-script-source (1.6.2), and Bundler cannot continue.
Make sure that `gem install coffee-script-source -v '1.6.2'` succeeds before bundling.
well.. no problem.. let's install this..
sudo gem install -p http://myproxy:8080 coffee-script-source -v '1.6.2'
Installing ri documentation for coffee-script-source-1.6.2
1 gem installed
Good. Try again.
bundle install
and stopped here:
Errno::EACCES: Permission denied - /Library/Ruby/Gems/1.8/build_info/execjs-1.4.0.info
An error occurred while installing execjs (1.4.0), and Bundler cannot continue.
Make sure that `gem install execjs -v '1.4.0'` succeeds before bundling.
!!!
Needless to say that I've installed this, tried again and the same error came up with different "gems".
My question is: is there a command to find if I've everything I need installed without doing these steps tons of times (also because they're pretty slow..)?
I've also tried bundling with sudo but maybe it's not working for the proxy.. : /
Thanks in advance
Just to help anyone still looking (I presume you fixed it in the end) running the command sudo chown myuser:myuser /Library/Ruby/Gems/1.8/build_info/ (where /Library/Ruby/Gems/1.8/build_info/ is the directory referenced in the error) fixed this.
I encourage you to install RVM (or rbenv) to install/uninstall ruby interpreters. Ruby interpreter bundled with Mac OS X is too old. Also gem installation procedure for system ruby interpreter requires superuser privileges.
If it is your first attempt to Rails world, please, start it with right tools, and actual ruby version (1.9.3).
Here you can find how to install RVM: https://rvm.io/rvm/install/
Good luck!