Could not open input file: yii when i start rbac migration - yii2

I'm new on mac, I'm trying to make migration for rbac, but i have error
Could not open input file: yii
I read a lot of answers and tried everything, but nothing suits me
what could be the problem?

as your ls statement shows, there's no yii file. (yii.bat doesn't count)
you need to run the init script again to generate it
php init

Related

What is the command to generate migration script from existing sequelize models?

I've created models using the following command.
$ node_modules/.bin/sequelize model:create --name XYZ --attributes "....."
But by mistake I deleted the folder containing migration script. Now I want to generate this script again.
I tried using sequelize migration:create, but it generated any empty file.
Please Help.
What you need to do now, after you generated a new migration file is to copy the skeleton from here: http://docs.sequelizejs.com/manual/tutorial/migrations.html#skeleton and to customize your migration using the functions that you need.

PhpStorm namespace to Laravel's app directory

I seem to be having an issue with PhpStorm and Laravel, where for some strange reason, every time that I manually create a new class file it uses the app for the beginning of the namespace - even though I've set the app name with artisan. When generating files via artisan - namespace is correct - it's just when I create files manually from within the PhpStorm.
I'm sure it's an easy fix - I just don't quite know where in the settings is the option to update it.
Right click on directory -> Mark directory As -> Sources Root

How can I run tests on a pre-populated database in Rails?

So I am writing acceptance tests for a single feature of a large App. I needed a lot of data for this and have a lot of scenarios to test; so I have pre-populated a mysql database using Sequel Pro.
Obviously the appname_test database is in place for the other tests in the app. I would like to know how I could load up a .sql file (which is a sql dump of content) into this database at the start of my tests (before the first context statement).
I am new to development so this is completely new to me. Thanks in advance for any help.
Update:
I have used the yaml_db gem to dump the dev db (db:data:dump) and then load it into the test db (db:data:load ENV_RAILS=test). However, as soon as I run my specs the test db is wiped clean! Is there a way to run db:data:load ENV_RAILS=test from inside the spec file. I have tried:
require 'rake'
Rake::Task['bundle exec db:data:load ENV_RAILS=test'].invoke
but it says Don't know how to build task 'be db:data:load ENV_RAILS=test'
OK, so here is what I did to solve this.
I used the yaml_db gem and rake db:data:dump which creates db/data.yml (a dump of the dev db).
I then had to write a library and rake task which converted the data.yml file into individual fixtures files. I run this new rake task once to create the fixure files.
Then, at the start of my spec I call fixtures :all which populates the test database with all the fixtures.

How do I use html5bolierplate build script?

Okay, so.
I've installed Ant.
Downloaded the build script. Extracted to Ant installation location.
When I run the 'runbuildscript' a cmd interface opens for around a second, and stops.
If I navigate to the location of files through CMD, then do ant minify it doesn't work.
I then thought to place and extract the build script in the location of the files.
Upon doing so, an error came -
BUILD FAILED
E:\NamanyayG\wamp\www\namanyayg\build.xml:150: The following error occurred whil
e executing this line:
E:\NamanyayG\wamp\www\namanyayg\build.xml:416: E:\NamanyayG\wamp\www\${dir.source} does not exist.
Please help me out, I'm thoroughly confused.
Build script expects some external process (in this case you) to set dir.source property.
The most sure way to set it is to define it on ant command line, e.g.
ant -Ddir.source=/path/to/dir.source

how to connect mysql databases in weka?

i want to use my mysql databases in weka in order to analysis data.
i download the mysql-connector-java-5.0.8-bin.jar and put that in weka folder in my program Files folder, and add this path to system variable path, but when i open the weka explorer and click the openDB, i don't know what should i write in the url textbox,
i don't know completely what should i do?
the error that i saw is:
problem connecting to database:
no suitable driver found for!
please give me a total guidance, thanks in advance.
add mysql-connector-java-5.1.12-bin.jar to CLASSPATH .
or put it in weka folder, navigate to weka installation folder and run command :
%java_home%/bin/java -Xmx300M -cp ".;weka.jar;mysql-connector-java-5.1.12-bin.jar;" weka.gui.GUIChooser
then click open DB and
fill in the proper user+password
put the url: jdbc:mysql://localhost:3306/DATABASENAME
Click Execute. The result window should show the results now.
For Weka 3.7.10, the classpath system environment variable is not took into account (at leat under Windows 7). The only working approach for me was to modify the RunWeka.ini file from the Weka installation folder as follows: the cp= setting was modified to:
cp=%CLASSPATH%;d:/Programs/jdbc/mysql-connector-java-5.1.26/mysql-connector-java-5.1.26-bin.jar
whereas only the %CLASSPATH%; setting was originally provided. Does not make much sense, but in worked.
find some introduction to WEKA and the environment variable:
http://weka.wikispaces.com/CLASSPATH
Copy mysql-connector-java-X.X.XX-bin.jar to /usr/share/java/
unizip /usr/share/java/weka.jar
edit: /usr/share/java/weka/experiment/DatabaseUtils.props
add:
jdbcDriver=com.mysql.jdbc.Driver
jdbcURL=jdbc:mysql://localhost:3306/test (with your server)
add shell
export CLASSPATH=/usr/share/java/mysql-connector-java-X.X.XX-bin.jar:
export CP=/usr/share/java/mysql-connector-java-X.X.XX-bin.jar::/usr/share/java/:/usr/shared/java/weka.jar
execute weka:
java -cp $CP -Xmx500m weka.gui.explorer.Explorer
Ready