Error while bundling Rails application (missing gems?) - ruby-on-rails

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!

Related

An error occurred while installing nio4r (2.3.1) - fresh rails install

I'm installing rails on a new machine (high sierra to be exact) i've gone through the setup rails from go rails, however whenever i go to bundle install this is the following error:
Errno::EACCES: Permission denied # dir_s_mkdir - /Users/jake/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/nio4r-2.3.1
An error occurred while installing nio4r (2.3.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '2.3.1'` succeeds before bundling.
I've downloaded command line tools, i've downloaded xcode (the actual app) I also accidentally downloaded postgres (via command line) first, before mysql. I'm unsure whether this has anything to do with it
thanks in advance!
It appears i've installed nio4r-2.3.1 in sudo, and therefore didn't have the correct permissions to access it when not in sudo. i ran the following command to change the directory:
sudo chown -R jake ~/.rbenv
big thanks to The Tin Man for his details post on this: - How to fix a bundle install "nio4r error" on Rails 5.0.0

How to fix permissions error when installing Rails on Windows

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.

Why can't I create a new application using Rails new command?

I think I might of messed with my RVM and didn't know it.
Whenever I use the Rails new command, I get an error saying it can't handle the JSON version.
I uninstalled Ruby and reinstalled v1.9.3 and then reinstalled Rails 4.0.1. Now I get a new error that is similar, just for a different gem.
Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/build_info/coffee-script-source-1.6.3.info
An error occurred while installing coffee-script-source (1.6.3), and Bundler
cannot continue.
Make sure that `gem install coffee-script-source -v '1.6.3'` succeeds before
bundling.
I have no idea what to do. I was wondering if anyone had any ideas on how to fix this problem.
you missed to use rvm ruby:
rvm use ruby
You need to run gem install coffee-script-source -v '1.6.3' as a the root user so that it can have access write to the gems install directory. You need to run: rvmsudo gem install coffee-script-source -v '1.6.3' this will sudo gem install it in the rvm context.
sudo chown jeff:jeff /Library/Ruby/Gems/2.0.0/build_info/
should do the trick

Running rails new and getting an error

I am trying to start a new rails project and I am getting this error message!
Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/build_info/coffee-script-2.2.0.info An error occurred while installing coffee-script (2.2.0), and Bundler cannot continue.
Make sure that `gem install coffee-script -v '2.2.0'` succeeds before bundling.
everything was fine until I upgraded to the mavericks OS. could that be the root of the problem?
I was able to figure it out, I did a bundle update then I used sudo to start a new rails app and it worked, thanks for the help. Also I had tried uninstalling RVM but when i tried to install it back i couldn't because i am using the new Maverick os.

Installing mysql2 gem for Ruby on Rails 3.1.0

I get this error
Gem files will remain installed in
/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17 for inspection.
Results logged to
/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.out
An error occured while installing mysql2 (0.2.17), and Bundler cannot
continue. Make sure that gem install mysql2 -v '0.2.17' succeeds
before bundling.
With a Ruby on Rails application and I can not solve it.
Most folks find this works:
sudo apt-get install libmysql-ruby libmysqlclient-dev
It's probably a compilation error. Maybe you don't have mysql development libs installed in your system.
I need to see the logs to make sure.
Try it and paste the output here:
cat /home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.out
Btw: wich operation system are you using?

Resources