After completing the Rails Tutorial I wanted to extend it into a personal app so I created another directory and moved/copied all the files from tutorialFolder to appFolder.
However I'm encountering some problems when I try to setup the gems again.
bundle install
returns:
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
So I try gem install pg -v '0.17.1
(or bundle update
) and get:
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Searching StackOverflow I discover Installing gem or updating RubyGems fails with permissions error
Which explains that /Library/Ruby/Gems/2.0.0
That is the version of Ruby installed by Apple, for their own use. While it's OK to make minor modifications to that if you know what you're doing, because you are not sure about the permissions problem, I'd say it's not a good idea to continue along that track.
To avoid the above I try brew install ruby
succesfully but get stuck on bundle install
I can't retrace where, but I also attempted to remove the Gemfile.lock but that didn't do anything.
Additional info: ruby -v
>>> ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
rails -v
>>> bin/spring:10:in 'read': No such file or directory - /Gemfile.lock (Errno::ENOENT)
bundle install --path vendor/bundle
>>> An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Thanks,
Edit* I tried starting from scratch with rails new app
however got this:
Bundle complete! 12 Gemfile dependencies, 54 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
run bundle exec spring binstub --all
/Library/Ruby/Gems/2.0.0/gems/bundler- 1.10.5/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find i18n-0.7.0 in any of the sources (Bundler::GemNotFound)
from /Library/Ruby/Gems/2.0.0/gems/bundler- 1.10.5/lib/bundler/spec_set.rb:85:in `map!'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/spec_set.rb:85:in `materialize'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:140:in `specs'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:185:in `specs_for'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/definition.rb:174:in `requested_specs'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/environment.rb:18:in `requested_specs'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/runtime.rb:13:in `setup'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler.rb:127:in `setup'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.5/lib/bundler/setup.rb:18:in `<top (required)>'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/Cellar/ruby/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
The above block was fixed with rvm gemset empty
and then I was able to setup a VANILLA rails app, still can't sync with end of tutorial