简体   繁体   中英

Hartl Chapter 3 gemfile bundle install issue

I am new to rails and am working through the Hartl online tutorial. I updated my gemfile as the book suggests to

source 'https://rubygems.org'

gem 'rails', '3.2.6'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.10.0'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.4'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.0'

group :test do
  gem 'capybara', '1.1.2'
end

group :production do
  gem 'pg', '0.12.2'
end

then went to my command prompt and entered: bundle install --without production

I keep getting the same error message stating: Errno::EACCES: Permission denied - C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/configure An error occured while installing ffi <1.0.11>, and the Bundler cannot continue. Make sure that 'gem install ffi -v '1.0.11' succeeds before bundling. Errno::EACCES: Permission denied - C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/configure An error occured while installing ffi <1.0.11>, and the Bundler cannot continue. Make sure that 'gem install ffi -v '1.0.11' succeeds before bundling.

I tried entering: gem install ffi and it successfully installs the gem but when I rerun the bundle install command I get the same error message.

Any suggestions?

I ran into a lot of problems when I was trying to install all of the gems. I installed them one by one until I figured out what was causing the problem. In my case uglifier was causing my problem.

I dont know if this well help, but I recently finished the tutorial and this was my gemfile. Keep in mind that I used mysql2 instead of sqlite3. If you want to use mysql, theres a great program called Sequel Pro. Good luck.

     source 'https://rubygems.org'
        gem 'rails', '3.2.3'
        gem 'bootstrap-sass', '2.0.0'
        gem 'execjs'
        gem 'therubyracer'
        gem 'mysql2'
        gem 'bcrypt-ruby', '3.0.1'
        gem 'faker', '1.0.1'
        gem 'will_paginate', '3.0.3'
        gem 'bootstrap-will_paginate', '0.0.6'
        gem 'launchy', '2.1.0'



    group :development, :test do
        gem 'sqlite3', '1.3.5'
        gem 'rspec-rails', '2.9.0'
    end

    # Gems used only for assets and not required
    # in production environments by default.

    group :assets do
        gem 'sass-rails', '3.2.4'
        gem 'coffee-rails', '3.2.2'
        gem 'uglifier', '1.2.3'
        end
        gem 'jquery-rails', '2.0.0'

    group :test do
        gem 'capybara', '1.1.2'
        gem 'factory_girl_rails', '1.4.0'
    end

    group :production do
        gem 'pg', '0.12.2'
    end

I expect you've found a solution or workaround by now, but I just hit exactly the same problem and when I deleted the cached version of ffi and re-ran bundler it installed just fine.

Edit: I also stopped the Rails server, which had been running. Maybe that did the trick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM