简体   繁体   中英

Devise not working with rails. (Undefined local variable or method `‘devise’' for Gemfile)

I've added gem 'devise' to the gem file after having done gem install devise.

I get the following error when I run bundle install:

Undefined local variable or method 'devise'' for Gemfile.`

My Gemfile looks like this:

source 'http://rubygems.org'

gem 'mysql'


gem 'rails', '4.0.4'

gem ’devise’

when I remove the gem devise bundle install works, otherwise I get the error undefined local variable or method devise for Gemfile.

If you're using TextEdit on Mac OSX, you may want to make sure that under your preferences Smart quotes is not checked. This will update your apostrophes and quotes into what is "typographically appropriate" according to the program. You're typing a single tick mark / prime mark (U+2027) and its converting it to a an apostrophe (U+2032). Alternately, you can hold the ctrl key while pressing the quote mark to get the non-slanted tick mark. I just spent 20 minutes with this same issue.

Your Gemfile should look like below

Gemfile:

source 'https://rubygems.org'
gem 'rails', '4.0.2'
gem 'devise'

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