ruby-openid: openid_login_generator by rails beginner

~/hdknr/hdknr がrailsでfreshに作られています。

 

hdknr@debiansept:~/hdknr/config$ grep "database:" database.yml | awk

‘{print $2}’ | while read  db ; do echo "create database $db"| sudo

mysql ; done
Password:
sudo: mysql: command not found
sudo: mysql: command not found
sudo: mysql: command not found

hdknr@debiansept:~/hdknr/config$ sudo apt-get install mysql-server-5.0

-y
(省略)
E: 問題が発生し、-y オプションが –force-yes なしで使用されました
hdknr@debiansept:~/hdknr/config$ sudo apt-get install mysql-server-5.0

-y –force-yes
(省略)

hdknr@debiansept:~/hdknr/config$ grep "database:" database.yml | awk

‘{print $2}’ | while read  db ; do echo "create database $db;grant all

privileges on $db.* to ‘hdknr’@’localhost’ identified by ‘hdknr’;"|

sudo mysql ; done

 

hdknr@debiansept:~/hdknr/config$ grep "database:" database.yml | awk

‘{print $2}’ | while read  db ; do echo "show tables" | sudo mysql $db

-u hdknr -p ;done
Enter password:
Enter password:
Enter password:

 

hdknr@debiansept:~/hdknr$ script/generate
Usage: script/generate generator [options] [args]

Rails Info:
    -v, –version                    Show the Rails version number and

quit.
    -h, –help                       Show this help message and quit.

General Options:
    -p, –pretend                    Run but do not make any changes.
    -f, –force                      Overwrite files that already

exist.
    -s, –skip                       Skip files that already exist.
    -q, –quiet                      Suppress normal output.
    -t, –backtrace                  Debugging: show backtrace on

errors.
    -c, –svn                        Modify files with subversion.

(Note: svn must be in path)

Installed Generators
  Builtin: controller, integration_test, mailer, migration, model,

observer, plugin, resource, scaffold, scaffold_resource,

session_migration, web_service

More are available at http://rubyonrails.org/show/Generators
  1. Download, for example, login_generator.zip
  2. Unzip to directory /home/hdknr/.rails/generators/login
     to use the generator with all your Rails apps
     or to /home/hdknr/hdknr/generators/login
     to use with this app only.
  3. Run generate with no arguments for usage information
       script/generate login

Generator gems are also available:
  1. gem search -r generator
  2. gem install login_generator
  3. script/generate login

 

hdknr@debiansept:~/hdknr$ gem search -r generator | grep login
login_generator (1.2.2)
login_sugar_generator (0.9.5.1)
openid_login_generator (0.1)
salted_login_generator (2.0.2)

hdknr@debiansept:~/hdknr$ sudo gem install -y ruby-openid
INFO:  `gem install -y` is now default and will be removed
INFO:  use –ignore-dependencies to install only the gems you list
Successfully installed ruby-openid-2.1.2
1 gem installed
Installing ri documentation for ruby-openid-2.1.2…
Installing RDoc documentation for ruby-openid-2.1.2…

 

hdknr@debiansept:~/hdknr$ sudo gem install -y ruby-openid
INFO:  `gem install -y` is now default and will be removed
INFO:  use –ignore-dependencies to install only the gems you list
Successfully installed ruby-openid-2.1.2
1 gem installed
Installing ri documentation for ruby-openid-2.1.2…
Installing RDoc documentation for ruby-openid-2.1.2…
hdknr@debiansept:~/hdknr$ sudo gem install -y openid_login_generator
INFO:  `gem install -y` is now default and will be removed
INFO:  use –ignore-dependencies to install only the gems you list
Successfully installed openid_login_generator-0.1
1 gem installed

hdknr@debiansept:~/hdknr$ sudo gem install -y ruby-yadis
INFO:  `gem install -y` is now default and will be removed
INFO:  use –ignore-dependencies to install only the gems you list
Successfully installed ruby-yadis-0.3.4
1 gem installed
Installing ri documentation for ruby-yadis-0.3.4…
Installing RDoc documentation for ruby-yadis-0.3.4…

hdknr@debiansept:~/hdknr$ script/generate  openid_login account
      create  lib/openid_login_system.rb
      create  app/controllers/account_controller.rb
      create  test/functional/account_controller_test.rb
      create  app/helpers/account_helper.rb
      create  app/models/user.rb
      create  test/unit/user_test.rb
      create  test/fixtures/users.yml
      create  app/views/layouts/scaffold.rhtml
      create  public/stylesheets/scaffold.css
      create  app/views/account
      create  app/views/account/welcome.rhtml
      create  app/views/account/login.rhtml
      create  app/views/account/logout.rhtml
      create  README_LOGIN

hdknr@debiansept:~/hdknr$ script/generate model user openid_url:string
      exists  app/models/
      exists  test/unit/
      exists  test/fixtures/
overwrite app/models/user.rb? [Ynaqd] n
        skip  app/models/user.rb
overwrite test/unit/user_test.rb? [Ynaqd] n
        skip  test/unit/user_test.rb
overwrite test/fixtures/users.yml? [Ynaqd] n
        skip  test/fixtures/users.yml
      create  db/migrate
      create  db/migrate/001_create_users.rb

hdknr@debiansept:~/hdknr$ rake db:migrate
(in /home/hdknr/hdknr)
rake aborted!
No such file or directory – /tmp/mysql.sock

(See full trace by running task with –trace)

hdknr@debiansept:~/hdknr$ vi config/database.yml
(id/pwd = hdknr/hdknr )
(socket: /var/run/mysqld/mysqld.sock)
hdknr@debiansept:~/hdknr$ rake db:migrate
(in /home/hdknr/hdknr)
== CreateUsers: migrating

=====================================================
— create_table(:users)
   -> 0.0364s
== CreateUsers: migrated (0.0370s)

============================================

hdknr@debiansept:~/hdknr$ grep "database:" config/database.yml | while  read x db ; do  echo "desc users" | mysql -u hdknr $db -p ; done
Enter password:
Field   Type    Null    Key     Default Extra
id      int(11) NO      PRI     NULL    auto_increment
openid_url      varchar(255)    YES             NULL
Enter password:
ERROR 1146 (42S02) at line 1: Table ‘hdknr_test.users’ doesn’t exist
Enter password:
ERROR 1146 (42S02) at line 1: Table ‘hdknr_production.users’ doesn’t

exist

hdknr@debiansept:~/hdknr$ mongrel_rails start
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready.  TERM => stop.  USR2 => restart.  INT => stop (no restart).
** Rails signals registered.  HUP => reload (without restart).  It might not work well.
** Mongrel 1.1 available at 0.0.0.0:3000
** Use CTRL-C to stop.

WS000027

gemのバージョンがruby-openidの想定より新しすぎるな。

#  require_gem "ruby-openid", ">= 1.0.2"
  gem "ruby-openid", ">= 1.0.2"

にして再起動。

WS000028

と画面がでました。が、

WS000030

WS000031

カテゴリー: 未分類 パーマリンク

ruby-openid: openid_login_generator by rails beginner への1件のフィードバック

  1. Unknown より:

    Hi,Do you need advertising displays, digital signages, advertising player and LCD displays? Please go Here:www.amberdigital.com.hk(Amberdigital).we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.
    amberdigital Contact Us
    website:www.amberdigital.com.hk
    alibaba:amberdigital.en.alibaba.com[dgfhacbjhejehbh]

コメントを残す

以下に詳細を記入するか、アイコンをクリックしてログインしてください。

WordPress.com ロゴ

WordPress.com アカウントを使ってコメントしています。 ログアウト / 変更 )

Twitter 画像

Twitter アカウントを使ってコメントしています。 ログアウト / 変更 )

Facebook の写真

Facebook アカウントを使ってコメントしています。 ログアウト / 変更 )

Google+ フォト

Google+ アカウントを使ってコメントしています。 ログアウト / 変更 )

%s と連携中