Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot Generate Model in ROR
    primarykey
    data
    text
    <p>I am new to ROR. I have installed mySql, Ruby, Rubygems and Rails, along with MacPorts. I have project named demo that I am trying to generate model name Movie for. I have also created a database named Movies.</p> <p>Here is the following error I am receiving when I try to generate a model from Terminal (Mac Lion).</p> <pre> rails generate model Movie /Library/Ruby/Gems/1.8/gems/bundler-1.2.3/lib/bundler/rubygems_integration.rb:187:in `stub_source_index170': no such file to load -- rubygems/source_index (LoadError) from /Library/Ruby/Gems/1.8/gems/bundler-1.2.3/lib/bundler/rubygems_integration.rb:353:in `stub_rubygems' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.3/lib/bundler/rubygems_integration.rb:250:in `replace_entrypoints' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.3/lib/bundler/runtime.rb:14:in `setup' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.3/lib/bundler.rb:116:in `setup' from /Library/Ruby/Gems/1.8/gems/bundler-1.2.3/lib/bundler/setup.rb:7 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:60:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:60:in `require' from /Users/josephcarlson/demo/config/boot.rb:6 from script/rails:5:in `require' from script/rails:5 </pre> <p>Here is my Gem list</p> <p><strong>* LOCAL GEMS *</strong></p> <p>actionmailer (3.2.11, 3.2.10) actionpack (3.2.11, 3.2.10) activemodel (3.2.11, 3.2.10) activerecord (3.2.11, 3.2.10) activeresource (3.2.11, 3.2.10) activesupport (3.2.11, 3.2.10) akami (1.2.0) arel (3.0.2) builder (3.0.4) bundler (1.2.3) coffee-rails (3.2.2) coffee-script (2.2.0) coffee-script-source (1.4.0) erubis (2.7.0) execjs (1.4.0) gyoku (1.0.0) hike (1.2.1) httparty (0.9.0) httpi (2.0.0) i18n (0.6.1) journey (1.0.4) jquery-rails (2.1.4) json (1.7.6) mail (2.4.4) mime-types (1.19) multi_json (1.5.0) multi_xml (0.5.1) mysql2 (0.3.11) nokogiri (1.5.6) nori (2.0.0) polyglot (0.3.3) rack (1.4.4, 1.4.3) rack-cache (1.2) rack-ssl (1.3.2) rack-test (0.6.2) rails (3.2.11, 3.2.10) railties (3.2.11, 3.2.10) rake (10.0.3) rdoc (3.12) sass (3.2.5) sass-rails (3.2.5) savon (2.0.2) sprockets (2.2.2) sqlite3 (1.3.7) thor (0.16.0) tilt (1.3.3) treetop (1.4.12) tzinfo (0.3.35) uglifier (1.3.0) wasabi (3.0.0)</p> <p>And here is the Gem Env</p> <p>RubyGems Environment: - RUBYGEMS VERSION: 1.8.24 - RUBY VERSION: 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin11.0] - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8 - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby - EXECUTABLE DIRECTORY: /usr/bin - RUBYGEMS PLATFORMS: - ruby - universal-darwin-11 - GEM PATHS: - /Library/Ruby/Gems/1.8 - /Users/josephcarlson/.gem/ruby/1.8 - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - <a href="http://rubygems.org/" rel="nofollow">http://rubygems.org/</a></p> <h2>UPDATE</h2> <p>The issue stemmed from an invalid line in the database.yml file. See below.</p> <p>development: adapter: mysql2 encoding: utf=8 database: test pool: 5 host: localhost username: xxxx passwoord: xxxxxx socket /tmp/mysql.sock</p> <p>So as you can see the encoding line and the socket lines were incorrect. I corrected those lines by removing the = in "utf=8" and adding ":" to the socket line. Once fixed I was able to generate models, controllers and/or a scaffolding.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload